/* Base Styles and CSS Variables */
:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --code-bg: #f3f4f6;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --max-width: 1200px;
    --spacing-unit: 1rem;
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

code {
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 0.9em;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
}

/* Header and Navigation */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.nav-menu a:hover {
    border-bottom-color: var(--primary-color);
    text-decoration: none;
}

#dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

#dark-mode-toggle:hover {
    background-color: var(--bg-secondary);
}

/* Main Content */
.content-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
}

section {
    margin-bottom: 4rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.truth-box {
    background-color: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.scenario {
    padding: 1.5rem;
    border-radius: 8px;
    text-align: left;
}

.scenario.correct {
    background-color: #d1fae5;
    border: 2px solid var(--success-color);
}

.scenario.incorrect {
    background-color: #fee2e2;
    border: 2px solid var(--error-color);
}

.scenario h3 {
    margin-bottom: 0.5rem;
}

.scenario ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.scenario li {
    margin-bottom: 0.5rem;
}

/* Alert Boxes */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border-color: var(--primary-color);
    color: #1e40af;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

/* Fact Cards */
.fact-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.fact-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.fact-card ul {
    padding-left: 1.5rem;
}

.fact-card li {
    margin-bottom: 0.5rem;
}

/* CTA Section */
.cta-section {
    background-color: var(--bg-secondary);
    padding: 3rem 2rem;
    border-radius: 8px;
    text-align: center;
}

.cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.cta-button {
    background-color: var(--bg-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
    color: var(--text-color);
}

.cta-button:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cta-button h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.cta-button:hover h3 {
    color: white;
}

.cta-button p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.cta-button:hover p {
    color: rgba(255, 255, 255, 0.9);
}

/* Updates Section */
.update-item {
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.update-item time {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 600;
}

.update-item h3 {
    margin: 0.5rem 0;
}

/* Latest updates section */
.latest-updates {
    margin: 4rem 0;
}

.update-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.update-item time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.update-item h3 {
    margin: 0.5rem 0;
}

/* CTA section */
.cta {
    margin: 4rem 0;
    text-align: center;
}

.cta h2 {
    margin-bottom: 2rem;
}

.cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.cta-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.cta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.cta-card h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1rem;
}

.cta-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .nav-container {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .nav-menu {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .content-wrapper {
        padding: 2rem 1rem;
    }
    
    .comparison {
        grid-template-columns: 1fr;
    }
    
    .cta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    #dark-mode-toggle,
    .cta-section {
        display: none;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .content-wrapper {
        max-width: 100%;
        padding: 0;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Article and Legal Content Styling */
.legal-content {
    max-width: 900px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.article-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin-top: 1rem;
}

.table-of-contents {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.table-of-contents h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
}

.table-of-contents li {
    margin-bottom: 0.5rem;
}

.table-of-contents a {
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.table-of-contents a:hover {
    background-color: var(--bg-color);
    text-decoration: none;
}

.case-study {
    border-left: 4px solid var(--primary-color);
    padding-left: 2rem;
    margin: 2rem 0;
}

.case-details {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.case-details h4 {
    color: var(--primary-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.case-details h4:first-child {
    margin-top: 0;
}

.case-analysis {
    margin: 1.5rem 0;
}

.success-text {
    color: var(--success-color);
    font-weight: 700;
}

.error-text {
    color: var(--error-color);
    font-weight: 700;
}

.references {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.references ul {
    padding-left: 1.5rem;
}

.references li {
    margin-bottom: 0.75rem;
}

.update-date {
    margin-top: 2rem;
    font-style: italic;
    color: #6b7280;
}

section {
    scroll-margin-top: 100px;
}

/* Language Tabs */
.language-tabs {
    margin-top: 1.5rem;
}

.tab-list {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.tab-button:hover {
    border-color: var(--primary-color);
}

.tab-button.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.tab-panel[hidden] {
    display: none;
}
