/* ===== CSS RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    font-size: 16px
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: color 0.3s ease, background-color 0.3s ease;
    overflow-x: hidden
}

/* ===== CSS CUSTOM PROPERTIES (VARIABLES) ===== */
:root {
    /* Light theme colors */
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --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);
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-text: linear-gradient(135deg, #2563eb 0%, #f59e0b 100%)
}

/* Dark theme colors */
.theme-toggle-input:checked ~ body,
body:has(.theme-toggle-input:checked) {
    --primary-color: #3b82f6;
    --secondary-color: #fbbf24;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --border-light: #4b5563;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    --gradient-secondary: linear-gradient(135deg, #fbbf24 0%, #fcd34d 100%);
    --gradient-text: linear-gradient(135deg, #3b82f6 0%, #fbbf24 100%)
}

/* ===== THEME TOGGLE ===== */
.theme-toggle-input {display: none}

.theme-toggle-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem
}

.theme-toggle-label:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.05)
}

.theme-toggle-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease
}

.theme-toggle-input:checked + body .theme-toggle-icon,
body:has(.theme-toggle-input:checked) .theme-toggle-icon {
    transform: rotate(180deg)
}

.theme-toggle-input:checked + body .theme-toggle-icon::before,
body:has(.theme-toggle-input:checked) .theme-toggle-icon::before {
    content: '☀️'
}

.theme-toggle-icon::before {
    content: '🌙'
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--text-primary)
}

h1 {font-size: 3.5rem}
h2 {font-size: 2.25rem}
h3 {font-size: 1.5rem}
h4 {font-size: 1.25rem}
h5 {font-size: 1.125rem}
h6 {font-size: 1rem}

p {
    margin-bottom: 1rem;
    color: var(--text-primary)
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease
}

a:hover {
    color: var(--secondary-color)
}

.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

/* ===== LAYOUT UTILITIES ===== */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md)
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color)
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem
}

.btn-icon {
    transition: transform 0.3s ease
}

.btn:hover .btn-icon {
    transform: translateX(4px)
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: all 0.3s ease
}

.theme-toggle-input:checked ~ body .navbar,
body:has(.theme-toggle-input:checked) .navbar {
    background-color: rgba(17, 24, 39, 0.95)
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none
}

.logo-accent {
    color: var(--secondary-color)
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease
}

.nav-link:hover {
    color: var(--primary-color)
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease
}

.nav-link:hover::after {
    width: 100%
}

.nav-actions {
    display: flex;
    align-items: center
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background-color: var(--bg-secondary);
    padding: 1rem 0;
    margin-top: 70px;
    border-bottom: 1px solid var(--border-light)
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem
}

.breadcrumb-list li:not(:last-child)::after {
    content: '>';
    margin-left: 0.5rem;
    color: var(--text-muted)
}

.breadcrumb-list a {
    color: var(--text-muted);
    font-size: 0.9rem
}

.breadcrumb-list span {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem
}

/* ===== ARTICLE STYLES ===== */
.article-section {
    padding: 4rem 0;
    background: var(--bg-primary)
}

.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4rem
}

.article-main {
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden
}

.article-header {
    padding: 3rem 3rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light)
}

.article-title {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary)
}

.article-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap
}

.article-category {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase
}

.article-summary {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    font-size: 1.1rem;
    line-height: 1.6
}

.article-summary p {
    margin: 0;
    color: var(--text-secondary)
}

/* Styles pour les images adaptatives */
.article-main .article-image {
    width: 100%;
    margin: 2rem 0;
    text-align: center;
}

.article-main .article-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.article-main .article-image img:hover {
    transform: scale(1.02);
}

.article-main .image-caption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
    line-height: 1.4;
}

/* Responsive pour les petits écrans */
@media (max-width: 768px) {
    .article-main .article-image {
        margin: 1.5rem 0;
    }
    
    .article-main .image-caption {
        font-size: 0.8rem;
        padding: 0 1rem;
    }
}

/* ===== TABLE OF CONTENTS ===== */
.table-of-contents {
    background: var(--bg-secondary);
    padding: 2rem 3rem;
    border-bottom: 1px solid var(--border-light)
}

.toc-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color)
}

.toc-list {
    list-style: none;
    counter-reset: toc-counter
}

.toc-list li {
    counter-increment: toc-counter;
    margin-bottom: 0.5rem
}

.toc-list a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease
}

.toc-list a:hover {
    color: var(--primary-color)
}

.toc-list a::before {
    content: counter(toc-counter) ". ";
    color: var(--primary-color);
    font-weight: 700;
    margin-right: 0.5rem
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
    padding: 3rem
}

.article-intro {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-light)
}

.content-section {
    margin-bottom: 4rem
}

.content-section h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color)
}

.content-section h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem
}

.definition-box {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 2rem;
    border-radius: 1rem;
    border-left: 5px solid var(--primary-color);
    margin: 2rem 0
}

.definition-box p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary)
}

/* ===== COMPARISON TABLE ===== */
.comparison-table {
    margin: 2rem 0;
    overflow-x: auto
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md)
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light)
}

.comparison-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px
}

.comparison-table tr:nth-child(even) {
    background: var(--bg-secondary)
}

.comparison-table tr:hover {
    background: var(--bg-tertiary)
}

.comparison-table td:first-child {
    font-weight: 600;
    color: var(--primary-color)
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: var(--gradient-secondary);
    color: white;
    padding: 3rem;
    border-radius: 1rem;
    text-align: center;
    margin: 3rem 0
}

.cta-content h3 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 1rem
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9
}

.cta-button {
    background: white;
    color: var(--secondary-color);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md)
}

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

/* ===== SIDEBAR ===== */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 90px;
    align-self: flex-start;
    max-height: calc(100vh - 110px);
    overflow-y: auto
}


.sidebar-widget {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    height: fit-content
}

.sidebar-widget h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light)
}

.related-articles {
    list-style: none
}

.related-articles li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light)
}

.related-articles li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0
}

.related-articles a {
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.3s ease
}

.related-articles a:hover {
    color: var(--primary-color)
}

/* ===== NEWSLETTER WIDGET ===== */
.newsletter {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid var(--primary-color)
}

.newsletter h3 {
    color: var(--primary-color)
}

.newsletter p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem
}

.newsletter-form input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color)
}

.newsletter-form button {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease
}

.newsletter-form button:hover {
    background: var(--secondary-color)
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
        gap: 2rem
    }
    
/*    .article-sidebar {
        order: -1
    }*/
    
    .article-title {
        font-size: 2rem
    }
    
    h1 {
        font-size: 2rem
    }
    
    h2 {
        font-size: 1.75rem
    }
}

@media (max-width: 768px) {
    .nav-list {
        display: none
    }
    
    .nav-toggle {
        display: flex
    }
    
    .article-header,
    .article-content,
    .table-of-contents {
        padding: 2rem 1.5rem
    }
    
    .article-title {
        font-size: 1.75rem
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem
    }
    
    .comparison-table {
        font-size: 0.9rem
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem
    }
    
    .cta-section {
        padding: 2rem 1.5rem
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.5rem
    }
    
    h1 {
        font-size: 1.75rem
    }
    
    h2 {
        font-size: 1.5rem
    }
    
    h3 {
        font-size: 1.25rem
    }
    
    .article-header,
    .article-content,
    .table-of-contents {
        padding: 1.5rem 1rem
    }
    
    .sidebar-widget {
        padding: 1.5rem
    }
    
    .cta-section {
        padding: 2rem 1rem
    }
}