/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors from design system */
    --black-pure: #000000;
    --black-elevated: #101010;
    --black-surface: #202020;
    --dark-gray: #2A2A2A;
    --mid-gray: #3A3A3A;
    
    --text-primary: #FFFFFF;
    --text-secondary: #C8D0D8;
    --text-muted: #8FA1B3;
    --text-disabled: #6B6B6B;
    
    --blue-primary: #003060;
    --blue-secondary: #004080;
    --blue-tertiary: #004890;
    --green-primary: #20A000;
    --green-hover: #2BC200;
    --green-active: #1A8A00;
    --red-primary: #D02040;
    --yellow-accent: #F0B000;
    
    /* Border radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 3rem 1rem;
    
    /* Transitions */
    --transition-base: 120ms ease-out;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #003060 0%, #002040 100%);
    color: var(--text-secondary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: var(--blue-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    padding: 1rem 0;
}

.header-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo-wrapper a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity var(--transition-base);
}

.logo-wrapper a:hover {
    opacity: 0.9;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-cta-wrapper {
    display: flex;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none !important;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-base);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.main-nav a:hover {
    color: var(--text-primary);
}

/* Table of Contents */
.toc-wrapper {
    background: var(--blue-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.75rem 0;
    overflow: hidden;
}

.toc-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.toc {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.toc::-webkit-scrollbar {
    display: none;
}

.toc-list {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

.toc-list li {
    flex-shrink: 0;
}

.toc-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    display: block;
    transition: color var(--transition-base);
    border-bottom: 2px solid transparent;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--text-primary);
    border-bottom-color: var(--green-primary);
}

/* Buttons */
.btn {
    min-width: 60px;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
}

.btn-primary {
    background: var(--green-primary);
    color: var(--text-primary);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
    background: var(--green-hover);
}

.btn-primary:active {
    background: var(--green-active);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-primary:focus {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.btn-primary:disabled {
    background: var(--dark-gray);
    color: var(--text-disabled);
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--black-surface);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: var(--dark-gray);
}

/* Hero Section */
#hero {
    padding: var(--section-padding);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

.hero-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-primary);
    line-height: 1.7;
}

.reading-time {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.reading-time-label {
    margin-right: 0.5rem;
}

.hero-image-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.hero-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.fact-checked {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Content Sections */
section[id^="aviator"],
section[id^="core"],
section[id^="live"],
section[id^="placing"],
section[id^="account"],
section[id^="mobile"],
section[id^="download"],
section[id^="playing"],
section[id^="final"] {
    padding: var(--section-padding);
}

section h1,
section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

section h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.section-image {
    margin: 2rem 0;
    text-align: center;
}

.section-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.content {
    margin-top: 1rem;
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--black-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

thead {
    background: var(--dark-gray);
}

th {
    padding: 1rem;
    text-align: left;
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

td {
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Author Section */
#author {
    padding: var(--section-padding);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.author-block {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--black-elevated);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.author-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--dark-gray);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.author-bio {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.author-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* FAQ Section */
#faq {
    padding: var(--section-padding);
}

#faq-title {
    margin-bottom: 2rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

details {
    background: var(--black-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
}

summary {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0;
    list-style: none;
    position: relative;
    padding-right: 2rem;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--green-primary);
    transition: transform var(--transition-base);
}

details[open] summary::after {
    content: '−';
    transform: translateY(-50%) rotate(0deg);
}

.faq-answer {
    padding-top: 1rem;
    color: var(--text-secondary);
}

.faq-answer p {
    margin-bottom: 0;
}

/* Footer */
footer {
    background: var(--black-elevated);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3rem 1rem 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    align-items: start;
}

.footer-logo a {
    display: inline-block;
    text-decoration: none;
    transition: opacity var(--transition-base);
}

.footer-logo a:hover {
    opacity: 0.9;
}

.footer-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-payments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.payment-icons img {
    height: 32px;
    width: auto;
    max-width: 64px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity var(--transition-base);
    display: block;
}

.payment-icons img:hover {
    opacity: 1;
}

.footer-gambleaware img {
    height: 40px;
    width: auto;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity var(--transition-base);
}

.footer-gambleaware a:hover img {
    opacity: 1;
}

.footer-copyright {
    grid-column: 1 / -1;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--green-primary);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
    transition: all var(--transition-base);
    z-index: 999;
}

.back-to-top:hover {
    background: var(--green-hover);
    transform: translateY(-2px);
}

.back-to-top:active {
    background: var(--green-active);
}

/* Utility Classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-top {
        padding: 0.75rem 0;
    }
    
    .header-container {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .logo-wrapper {
        flex: 0 0 auto;
    }
    
    .header-cta-wrapper {
        display: flex;
        gap: 0.5rem;
        flex: 1 1 auto;
        justify-content: flex-end;
    }
    
    .header-cta-wrapper .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: auto;
        white-space: nowrap;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }
    
    .main-nav li {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .main-nav li:last-child {
        border-bottom: none;
    }
    
    .hero-body {
        grid-template-columns: 1fr;
    }
    
    .hero-image-wrapper {
        order: -1;
    }
    
    .author-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .payment-icons {
        justify-content: center;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
    
    .table-wrapper {
        margin: 1rem 0;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th,
    td {
        padding: 0.75rem 0.5rem;
    }
}

/* Table Card Transformation for Mobile */
@media (max-width: 768px) {
    .table-wrapper {
        display: block;
    }
    
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }
    
    thead {
        display: none;
    }
    
    tr {
        background: var(--black-elevated);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: var(--radius-md);
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    td {
        border: none;
        padding: 0.5rem 0;
        text-align: left;
        position: relative;
        padding-left: 40%;
    }
    
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 35%;
        font-weight: 600;
        color: var(--text-primary);
    }
}
