/**
 * Joint Alignment Compendium - Modern CSS Stylesheet
 * Design: Clean, Medical, Professional
 * Author: Julian Marques
 */

/* ==================== CSS Variables ==================== */
:root {
    /* Primary Colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    /* Accent Colors */
    --accent-teal: #14b8a6;
    --accent-teal-light: #5eead4;
    --accent-purple: #8b5cf6;
    --accent-orange: #f97316;
    --accent-pink: #ec4899;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
}

/* ==================== App Container ==================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== Header ==================== */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-teal));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.025em;
}

.logo-text .highlight {
    background: linear-gradient(135deg, var(--primary-600), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.nav-link.active {
    color: var(--primary-600);
    background: var(--primary-50);
}

/* ==================== Hero Section ==================== */
.hero-section {
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 50%, var(--accent-teal) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.title-gradient {
    display: block;
    background: linear-gradient(135deg, #fff 0%, var(--accent-teal-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-light {
    font-weight: 300;
    opacity: 0.9;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.hero-description {
    font-size: 1rem;
    opacity: 0.7;
}

/* ==================== Body Section ==================== */
.body-section {
    padding: 4rem 2rem;
    flex: 1;
}

.body-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Body Figure */
.body-figure {
    position: relative;
    display: flex;
    justify-content: center;
}

.human-body-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* Body Parts Styling */
.body-part {
    fill: var(--gray-200);
    stroke: var(--gray-400);
    stroke-width: 1.5;
    transition: all var(--transition);
}

.body-part.active-region {
    fill: var(--primary-200);
    stroke: var(--primary-500);
    cursor: pointer;
}

.body-part.active-region:hover {
    fill: var(--primary-300);
    stroke: var(--primary-600);
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.4));
}

.hip-joint-marker {
    fill: var(--primary-600);
    stroke: white;
    stroke-width: 2;
    animation: pulse-marker 2s ease-in-out infinite;
}

@keyframes pulse-marker {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.hip-link {
    cursor: pointer;
}

/* Pulse Indicators */
.pulse-indicator {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-500);
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

.pulse-left {
    left: calc(50% - 50px);
    top: 46%;
}

.pulse-right {
    left: calc(50% + 25px);
    top: 46%;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.5);
        opacity: 0.6;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Region Cards */
.region-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.region-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
}

.region-card:not(.disabled):hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

.region-card.active-card {
    border-color: var(--primary-500);
    background: linear-gradient(135deg, var(--primary-50), white);
}

.region-card.active-card:hover {
    border-color: var(--primary-600);
    box-shadow: var(--shadow-xl), 0 0 0 4px var(--primary-100);
}

.region-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.active-card .card-icon {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
    color: white;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.card-content p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.card-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-status.available {
    background: var(--success);
    color: white;
}

.card-status.coming-soon {
    background: var(--gray-200);
    color: var(--gray-600);
}

.card-arrow, .card-lock {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.active-card .card-arrow {
    color: var(--primary-500);
}

.card-arrow svg, .card-lock svg {
    width: 20px;
    height: 20px;
}

/* ==================== Features Section ==================== */
.features-section {
    padding: 4rem 2rem;
    background: white;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--primary-600);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ==================== Footer ==================== */
.main-footer {
    background: var(--gray-900);
    color: white;
    padding: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.footer-copyright {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* ==================== Breadcrumb ==================== */
.breadcrumb {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.breadcrumb-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-600);
}

.breadcrumb-separator {
    color: var(--gray-400);
}

.breadcrumb-current {
    color: var(--gray-800);
    font-weight: 500;
}

/* ==================== Page Container ==================== */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ==================== Category Page ==================== */
.category-header {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent-teal) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    text-align: center;
}

.category-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-200);
}

.category-card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.category-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
    flex: 1;
}

.category-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-count {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.card-arrow-small {
    color: var(--primary-500);
    transition: transform var(--transition);
}

.category-card:hover .card-arrow-small {
    transform: translateX(4px);
}

/* ==================== Article List ==================== */
.article-list {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.article-list-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.article-list-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.article-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover {
    background: var(--gray-50);
}

.article-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    flex-shrink: 0;
}

.article-info {
    flex: 1;
}

.article-info h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.article-info p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ==================== Article Page ==================== */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.article-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 3rem;
}

.article-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-200);
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.article-content ul, .article-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

/* Info Boxes */
.info-box {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box.info {
    background: var(--primary-50);
    border-color: var(--primary-500);
}

.info-box.warning {
    background: #fef3c7;
    border-color: var(--warning);
}

.info-box.danger {
    background: #fee2e2;
    border-color: var(--danger);
}

.info-box.success {
    background: #d1fae5;
    border-color: var(--success);
}

.info-box-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.article-content th {
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--gray-200);
}

.article-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
}

.article-content tr:hover {
    background: var(--gray-50);
}

/* Paper Links */
.paper-list {
    margin-top: 1rem;
}

.paper-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: all var(--transition);
    border: 1px solid var(--gray-200);
}

.paper-link:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
}

.paper-icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-500);
    flex-shrink: 0;
}

.paper-info {
    flex: 1;
}

.paper-info span {
    font-weight: 500;
}

.paper-info small {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ==================== Back Button ==================== */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition);
    margin-bottom: 1.5rem;
}

.back-button:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.back-button svg {
    width: 16px;
    height: 16px;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .body-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .body-figure {
        order: 2;
    }

    .region-cards {
        order: 1;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .body-section {
        padding: 2rem 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .article-content {
        padding: 1.5rem;
    }

    .article-content h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .region-card {
        padding: 1rem;
    }

    .card-icon {
        width: 40px;
        height: 40px;
    }
}

/* ==================== Page Wrapper ==================== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== Article Hero ==================== */
.article-hero {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 50%, var(--accent-teal) 100%);
    color: white;
    padding: 3rem 2rem;
    position: relative;
}

.article-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.article-hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.article-category {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.article-reading-time {
    font-size: 0.875rem;
    opacity: 0.9;
}

.article-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* ==================== Article Container with TOC ==================== */
.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ==================== Table of Contents ==================== */
.article-toc {
    position: sticky;
    top: 100px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.toc-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.toc-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc-nav {
    padding: 0.5rem 0;
}

.toc-link {
    display: block;
    padding: 0.5rem 1.25rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all var(--transition);
}

.toc-link:hover {
    color: var(--primary-600);
    background: var(--gray-50);
}

.toc-link.active {
    color: var(--primary-600);
    background: var(--primary-50);
    border-left-color: var(--primary-500);
    font-weight: 500;
}

/* ==================== Article Content Sections ==================== */
.article-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2.5rem;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-500);
}

.content-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-section p {
    color: var(--gray-700);
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ==================== Alert Boxes ==================== */
.alert-box {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-content h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alert-content ul {
    margin-top: 0.5rem;
    padding-left: 1.25rem;
}

.alert-content li {
    margin-bottom: 0.25rem;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid var(--warning);
}

.alert-warning h4 {
    color: #92400e;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left: 4px solid var(--success);
}

.alert-success h4 {
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left: 4px solid var(--danger);
}

.alert-danger h4 {
    color: #991b1b;
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--gray-50), white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.stat-description {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.5;
}

/* ==================== Info Box Enhanced ==================== */
.info-box {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-500);
    background: linear-gradient(135deg, var(--primary-50), white);
}

.info-box h4 {
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 0.75rem;
}

.info-box ul {
    padding-left: 1.25rem;
    margin: 0;
}

.info-box li {
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.info-box.info-blue {
    border-color: var(--info);
    background: linear-gradient(135deg, #eff6ff, white);
}

.info-box.info-blue h4 {
    color: var(--primary-700);
}

/* ==================== Parameter Grid ==================== */
.parameter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.parameter-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.parameter-card.fixed {
    border-top: 4px solid var(--accent-teal);
}

.parameter-card.variable {
    border-top: 4px solid var(--accent-orange);
}

.parameter-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.parameter-icon {
    font-size: 1.5rem;
}

.parameter-header h4 {
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.parameter-content {
    padding: 1.25rem;
}

.parameter-item {
    margin-bottom: 1rem;
}

.parameter-item:last-child {
    margin-bottom: 0;
}

.parameter-item strong {
    display: block;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.parameter-item p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.parameter-norm {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.parameter-formula {
    display: inline-block;
    background: var(--primary-100);
    color: var(--primary-700);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: monospace;
}

/* ==================== Classification Grid ==================== */
.classification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.classification-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
}

.classification-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.classification-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.classification-badge {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.classification-header h4 {
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.group-1a .classification-badge,
.group-1a .classification-header {
    background: linear-gradient(135deg, #10b981, #059669);
}

.group-1a .classification-header {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
}

.group-1a .classification-header h4 {
    color: #065f46;
}

.group-1b .classification-badge,
.group-2a .classification-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.group-1b .classification-header,
.group-2a .classification-header {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.group-1b .classification-header h4,
.group-2a .classification-header h4 {
    color: #92400e;
}

.group-2b .classification-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.group-2b .classification-header {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.group-2b .classification-header h4 {
    color: #991b1b;
}

.classification-content {
    padding: 1.25rem;
}

.classification-criteria,
.classification-recommendation {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.classification-risk {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.classification-risk.low {
    background: #d1fae5;
    color: #065f46;
}

.classification-risk.medium {
    background: #fef3c7;
    color: #92400e;
}

.classification-risk.high {
    background: #fee2e2;
    color: #991b1b;
}

/* Classification Simple Grid */
.classification-simple-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.classification-simple-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.classification-simple-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.classification-simple-card p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

/* ==================== Styled Lists ==================== */
.styled-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.styled-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.styled-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
    border-radius: 50%;
}

.styled-list.numbered {
    counter-reset: item;
}

.styled-list.numbered li::before {
    content: counter(item);
    counter-increment: item;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0.1em;
}

/* ==================== Calculator ==================== */
.calculator-container {
    background: linear-gradient(135deg, #fefce8, #fef3c7);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 1.5rem 0;
}

.calculator-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.input-group input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.calculator-result {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 2px solid var(--primary-200);
}

.calculator-result h4 {
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 1rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.result-item {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.result-item.full-width {
    grid-column: 1 / -1;
}

.result-item h5 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.result-item p {
    margin: 0;
    color: var(--gray-700);
}

.result-class {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-600);
}

/* ==================== Therapy Grid ==================== */
.therapy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.therapy-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.therapy-header {
    padding: 1rem 1.25rem;
}

.therapy-header h4 {
    font-weight: 600;
    color: white;
    margin: 0;
}

.therapy-header.group-1a {
    background: linear-gradient(135deg, #10b981, #059669);
}

.therapy-header.group-1b {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.therapy-header.group-2a {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.therapy-header.group-2b {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.therapy-content {
    padding: 1.25rem;
}

.therapy-row {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.therapy-note {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--gray-100);
    color: var(--gray-600);
}

.therapy-note.warning {
    background: #fef3c7;
    color: #92400e;
}

.therapy-note.danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ==================== Key Messages ==================== */
.key-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.key-message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-50), white);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-500);
}

.key-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.key-message p {
    margin: 0;
    color: var(--gray-700);
    line-height: 1.6;
}

/* ==================== Literature List ==================== */
.literature-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.literature-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-300);
}

.literature-number {
    width: 28px;
    height: 28px;
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.literature-content {
    flex: 1;
}

.literature-authors {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.literature-title {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.literature-journal {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-style: italic;
}

/* ==================== Workflow Steps ==================== */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.workflow-step {
    display: flex;
    gap: 1.5rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-500);
    transition: all var(--transition);
}

.workflow-step:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.step-content p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

/* ==================== Tip Cards ==================== */
.tip-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-50), white);
    border-bottom: 1px solid var(--gray-200);
}

.tip-icon {
    font-size: 1.5rem;
}

.tip-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.tip-content {
    padding: 1.25rem;
}

.tip-content p {
    color: var(--gray-700);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.tip-recommendation {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary-50), #e0f2fe);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--primary-700);
}

/* ==================== Intro Text ==================== */
.intro-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

/* ==================== Systems Grid (Robotik) ==================== */
.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.system-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition);
}

.system-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.system-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.system-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.system-brand {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
}

.system-header.mako {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.system-header.rosa {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.system-header.cori {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.system-header.velys {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.system-content {
    padding: 1.25rem;
}

.system-row {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.system-row:last-child {
    margin-bottom: 0;
}

.system-row.highlight {
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary-50), #e0f2fe);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-500);
    margin-top: 1rem;
}

/* ==================== Advantage Grid ==================== */
.advantage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.advantage-card {
    background: linear-gradient(135deg, var(--gray-50), white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}

.advantage-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.advantage-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.advantage-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.advantage-card p {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

/* ==================== Indication Cards ==================== */
.indication-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.indication-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.indication-icon {
    font-size: 1.5rem;
}

.indication-header h4 {
    font-weight: 600;
    color: white;
    margin: 0;
}

.indication-card.absolute .indication-header {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.indication-card.relative .indication-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.indication-card.optional .indication-header {
    background: linear-gradient(135deg, #10b981, #059669);
}

.indication-content {
    padding: 1.25rem;
}

/* ==================== Limitation Grid ==================== */
.limitation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.limitation-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border-left: 4px solid var(--warning);
}

.limitation-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

/* ==================== Future Grid ==================== */
.future-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.future-card {
    background: linear-gradient(135deg, var(--primary-50), white);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
}

.future-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.future-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.future-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

/* ==================== Responsive Article Adjustments ==================== */
@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
    }

    .article-toc {
        position: relative;
        top: 0;
        display: none;
    }

    .article-hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .article-hero {
        padding: 2rem 1rem;
    }

    .article-hero h1 {
        font-size: 1.75rem;
    }

    .article-content {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .parameter-grid,
    .classification-grid,
    .therapy-grid {
        grid-template-columns: 1fr;
    }

    .calculator-inputs {
        grid-template-columns: 1fr;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .main-header,
    .main-footer,
    .back-button,
    .article-toc,
    .calculator-container {
        display: none;
    }

    body {
        background: white;
    }

    .article-content {
        box-shadow: none;
        padding: 0;
    }

    .article-hero {
        background: var(--gray-100);
        color: var(--gray-800);
    }
}
