/* Lighter Dark Theme for Results Pages – Soft & Rounded (10px) */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

body {
    font-family: 'Inter', sans-serif !important;
    background: #5c4d73 !important;           /* Very dark navy-gray instead of pure black */
    color: #e0e0e0 !important;                /* Soft light gray text */
    margin: 0 !important;
    padding: 20px !important;
    line-height: 1.5 !important;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #ffffff, #00ff88) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin: 0 0 20px 0 !important;
}

/* Cards, tables, headers – everything rounded 10px */
.iframe-header,
table,
.result-item,
.seq-nav,
#rotate-tip,
.table-wrapper,
.results-iframe {
    border-radius: 10px !important;
    overflow: hidden !important;
}

/* Header bar (back button area) */
.iframe-header {
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 12px !important;
    margin-bottom: 15px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
}

/* Back / Home button – big friendly green */
.back-button {
    padding: 11px 28px !important;
    background: linear-gradient(135deg, #00ff88, #00d4ff) !important;
    color: #000 !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-family: 'Space Grotesk', sans-serif !important;
    font-size: 1rem !important;
    box-shadow: 0 8px 25px rgba(0, 255, 136, 0.35) !important;
    transition: all 0.3s ease !important;
}

.back-button:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 35px rgba(0, 255, 136, 0.5) !important;
}

/* Tables – light translucent cards */
table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
}

th, td {
    padding: 10px 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #e0e0e0 !important;
}

th {
    background: linear-gradient(135deg, #00ff88, #00d4ff) !important;
    color: #000 !important;
    font-weight: 600 !important;
    text-align: left !important;
}

tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04) !important;
}

/* Results list cards (year groups) */
.result-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 22px 28px !important;
    margin-bottom: 16px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.4s ease !important;
}

.result-item:hover {
    transform: translateY(-6px) !important;
    border-color: #00ff88 !important;
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.25) !important;
    background: rgba(255, 255, 255, 0.09) !important;
}

.result-name {
    font-size: 1.15rem !important;
    font-weight: 500 !important;
    color: #f0f0f0 !important;
}

.view-button {
    padding: 11px 28px !important;
    background: transparent !important;
    color: #f8f9fa !important;
    border: 2px solid #00ff88 !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-family: 'Space Grotesk', sans-serif !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.view-button:hover {
    background: #00ff88 !important;
    color: #000 !important;
    transform: translateY(-2px) !important;
}

/* Year headings */
.results-year-heading {
    font-size: clamp(2rem, 4vw, 2.8rem) !important;
    margin: 60px 0 30px 0 !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid rgba(0, 255, 136, 0.3) !important;
}

/* Rotate tip & seq nav – softer look */
#rotate-tip,
.seq-nav {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #00ff88 !important;
    backdrop-filter: blur(10px) !important;
}

a {
    color: #00ff88 !important;
}

a:hover {
    color: #00d4ff !important;
}

/* ===============================================
   MOBILE LANDSCAPE: Full-width tables + smaller fonts
   =============================================== */
@media (max-width: 1024px) and (orientation: landscape) {
    body {
        padding: 8px !important;           /* Less padding to gain space */
        background: #0a0a0a !important;    /* Match the dark theme used in viewer */
        font-size: 12px !important;        /* Base font smaller */
        line-height: 1.4 !important;
    }

    h1, h2, h3, h4, h5, h6 {
        font-size: 1.4em !important;       /* Scale headings down */
        margin: 0 0 12px 0 !important;
    }

    table {
        width: 100% !important;
        font-size: 11px !important;        /* Critical: smaller table text */
        border-collapse: separate !important;
        border-spacing: 0 4px !important;   /* Slight vertical breathing room */
    }

    th, td {
        padding: 6px 8px !important;       /* Compact padding */
        white-space: nowrap !important;    /* Prevent text wrapping that breaks layout */
        overflow: hidden;
        text-overflow: ellipsis;
    }

    th {
        font-size: 12px !important;        /* Slightly larger headers for clarity */
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* Optional: slight zebra striping intensity reduction for density */
    tr:nth-child(even) {
        background: rgba(255, 255, 255, 0.03) !important;
    }

    /* Ensure any navigation bar is compact */
    .seq-nav {
        padding: 6px 10px !important;
        font-size: 11px !important;
        margin-bottom: 8px !important;
    }

    /* Back buttons in header (if present in the served page) */
    .back-button {
        padding: 6px 14px !important;
        font-size: 0.8rem !important;
    }
}
/* ===============================================
   MOBILE PORTRAIT: Smaller fonts for better fit
   =============================================== */
@media (max-width: 768px) and (orientation: portrait) {
    body {
        padding: 10px !important;
        font-size: 13px !important;        /* Smaller base font */
        line-height: 1.4 !important;
        background: #0a0a0a !important;    /* Match the darker viewer theme */
    }

    h1, h2, h3, h4, h5, h6 {
        font-size: 1.6em !important;
        margin: 0 0 14px 0 !important;
    }

    table {
        font-size: 12px !important;        /* Main table text smaller */
        border-spacing: 0 3px !important;
    }

    th, td {
        padding: 7px 9px !important;        /* Slightly tighter */
    }

    th {
        font-size: 13px !important;
    }

    .seq-nav {
        padding: 7px 10px !important;
        font-size: 12px !important;
    }

    /* Optional: make any back buttons in served pages smaller too */
    .back-button {
        padding: 8px 16px !important;
        font-size: 0.9rem !important;
    }
}