/* style.css - Updated to fix layout shifts and loading issues */

/* --- Base & Typography --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    padding: 0; /* Body padding-top will be set by JavaScript for fixed header */
    background-color: #f4f4f9; /* Light grey page background */
    color: #333;
    font-size: 13px;
    line-height: 1.5;
}

.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

.main-content-area {
    margin-top: 0; /* Let body padding-top handle space for fixed header */
}

/* --- Header Style (New Simpler Layout) --- */
header {
    background-color: #2c3e50; /* Dark blue/charcoal */
    color: #ffffff;
    padding: 10px 15px;
    border-bottom: 3px solid #e74c3c; /* Red accent line */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
}

.header-content-wrapper {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header .logo-main-header {
    font-size: 1.6em;
    font-weight: bold;
    text-decoration: none;
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
}
header .logo-main-header:hover {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

header .site-title-group-main-header {
    text-align: left;
    flex-grow: 1;
}

header .site-title-group-main-header h1 {
    margin: 0 0 1px 0;
    font-size: 1.8em;
    font-weight: 700;
    color: #ffffff;
}
header .site-title-group-main-header p.tagline-main-header {
    margin: 0;
    font-size: 0.8em;
    font-weight: 300;
    color: #bdc3c7;
}
header p.contact-info-main-header {
    margin: 0;
    font-size: 0.8em;
    color: #ecf0f1;
    font-style: italic;
    text-align: right;
    white-space: nowrap;
}

/* Page Navigation (Below Header, in .main-content-area) */
nav.page-navigation {
    background-color: #ffffff;
    padding: 6px 0;
    margin-top: 10px;
    margin-bottom: 10px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    position: sticky;
    z-index: 999;
}

nav.page-navigation ul {
    list-style: none;
    padding: 0 10px; /* Add some padding so scrolled items don't touch edges */
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap; /* IMPORTANT: Prevent wrapping */
    justify-content: flex-start; /* Align items to the start, let overflow handle the rest */
    align-items: center;
    overflow-x: auto; /* IMPORTANT: Enable horizontal scrolling for the UL */
    -ms-overflow-style: none;  /* Hide scrollbar on IE and Edge */
    scrollbar-width: none;  /* Hide scrollbar on Firefox */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
nav.page-navigation ul::-webkit-scrollbar {
    display: none; /* Hide scrollbar on Chrome, Safari, Opera */
}

nav.page-navigation ul li {
    margin: 0 8px; /* Consistent horizontal margin */
    flex-shrink: 0; /* Prevent items from shrinking */
}

nav.page-navigation ul li a.page-nav-link,
nav.page-navigation ul li button.button-as-link {
    text-decoration: none;
    color: #3498db;
    font-weight: 500;
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-block;
    white-space: nowrap; /* Ensure link text itself doesn't wrap */
}

/* --- View Toggle & Page Title Spacing --- */
.view-toggle-container {
    text-align: right;
    margin-top: 10px;
    margin-bottom: 5px;
}
#viewDesktopToggleBtn {
    background-color: #6c757d; color: white; border: none;
    padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 0.8em;
}
#viewDesktopToggleBtn:hover { background-color: #5a6268; }

h2.page-section-title {
    color: #2c3e50;
    font-size: 1.6em;
    margin-top: 10px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #bdc3c7;
    font-weight: 600;
}

/* --- Legend Styling (Compact Inline Version) - FIXED POSITIONING --- */
.legend-container {
    background-color: #f8f9fa; /* Light background to stand out */
    padding: 8px 12px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.75em;
    line-height: 1.4;
    text-align: left;
    display: block;
    min-height: 60px; /* FIXED: Reserve consistent space */
    box-sizing: border-box;
}
.legend-container h3 { display: none; } /* Hide "Rankings Legend" title */
p.legend-inline-list {
    margin: 0;
    padding: 0;
    color: #555;
}
p.legend-inline-list strong {
    color: #000;
    font-weight: 600;
}

/* FIXED: Remove the loading placeholder content that was causing issues */
#teamLegendContainer:empty,
#conferenceOverviewLegendContainer:empty,
#conferenceTeamsLegendContainer:empty {
    /* Remove the ::before pseudo-element that was adding "Loading..." text */
}

/* --- NEW: Loading State Styling --- */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px; /* Reserve space to prevent layout shift */
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state .loading-message {
    font-size: 1.1em;
    color: #666;
    font-weight: 500;
    margin: 0;
}

/* --- Table Styling - FIXED LAYOUT SHIFT ISSUES --- */
div[id$="TableContainer"] {
    /* REMOVED: The height/flex properties that were causing issues */
    min-height: 400px; /* Reserve minimum space */
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: block; /* Always block display */
}

div[id$="TableContainer"].loaded {
    min-height: auto; /* Allow natural height when loaded */
}

/* FIXED: Specific conference containers need same treatment */
#conferenceOverviewTableContainer,
#conferenceTeamsTableContainer {
    min-height: 400px; /* Reserve minimum space */
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: block; /* Always block display */
}

#conferenceOverviewTableContainer.loaded,
#conferenceTeamsTableContainer.loaded {
    min-height: auto; /* Allow natural height when loaded */
}

.table-wrapper {
    overflow-x: auto;
    background-color: #f4f4f9; /* Match body background */
    border: 1px solid #dee2e6;
    border-radius: 4px;
    max-height: 75vh;
    overflow-y: auto;
    margin-bottom: 20px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    background-color: #ffffff;
}
th, td {
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}
th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}
tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
} /* Light grey for odd */
tbody tr:nth-child(even) {
    background-color: #ffffff;
} /* White for even */
tbody tr:hover {
    background-color: #e9ecef;
}

/* Team Logo in Table */
td.team-name-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}
.table-team-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Hot/Cold Streak Indicators - Targeting the SPAN around team name text */
.team-row td.team-name-cell span.team-name-text.hot-streak-text {
    background-color: #d4edda;
    color: #155724;
    padding: 1px 3px;
    border-radius: 3px;
}
.team-row td.team-name-cell span.team-name-text.cold-streak-text {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1px 3px;
    border-radius: 3px;
}
/* Rating cell gets only the arrow */
.team-row.hot-streak td:nth-child(5), /* Rating column index */
.team-row.cold-streak td:nth-child(5) { /* Rating column index */
    background-color: inherit !important;
    color: inherit !important;
}
.rating-arrow {
    font-size: 0.8em;
    margin-left: 3px;
    vertical-align: middle;
}
.rating-arrow.up-arrow {
    color: green;
}
.rating-arrow.down-arrow {
    color: red;
}

/* --- Mobile View Table Column Hiding & Toggle --- */
.table-wrapper th.mobile-hide,
.table-wrapper td.mobile-hide {
    display: none;
}
.table-wrapper th.mobile-show,
.table-wrapper td.mobile-show {
    display: table-cell;
}
body.desktop-view-active .table-wrapper th.mobile-hide,
body.desktop-view-active .table-wrapper td.mobile-hide {
    display: table-cell;
}

/* --- Loading Message, RecentRankings, Footer --- */
.loading-message {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #555;
}
#recentRankingsSection {
    display: none;
}
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background-color: #343a40;
    color: #adb5bd;
    font-size: 0.85em;
}
footer p {
    margin: 5px 0;
}

/* =============================================================================
   ABOUT PAGE COMPONENTS (moved from inline styles)
   ============================================================================= */

/* About Hero Section */
.about-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 0.5rem 2rem;
    margin: -10px -10px 3rem -10px;
    border-radius: 0 0 30px 30px;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid #e74c3c;
}

.about-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: #bdc3c7;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    position: relative;
    z-index: 2;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: #e74c3c;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    display: block;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.stat-label {
    font-size: 0.9rem;
    color: #bdc3c7;
    font-weight: 500;
}

.story-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin: 3rem 0;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 1px solid #dee2e6;
}

.story-section.reverse {
    border-left: none;
    border-right: 4px solid #e74c3c;
}

.story-section.reverse .story-content {
    order: 2;
}

.story-section.reverse .story-media {
    order: 1;
}

.story-content h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.story-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1.2rem;
}

.story-media {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 1px solid #dee2e6;
}

.story-media:hover {
    transform: scale(1.02);
}

.story-media video,
.story-media img {
    width: 100%;
    height: auto;
    display: block;
}

.media-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(44, 62, 80, 0.9));
    color: #bdc3c7;
    padding: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

.throne-section {
    text-align: center;
    padding: 3rem 0;
    margin: 3rem 0;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    border: 1px solid #e9ecef;
}

.throne-image {
    max-width: 325px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
}

.throne-image:hover {
    transform: scale(1.02);
}

.throne-caption {
    font-size: 1.1rem;
    font-style: italic;
    color: #6c757d;
    font-weight: 500;
}

.features-section {
    margin: 4rem 0;
}

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

.feature-card {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #3498db;
}

.feature-card:nth-child(2)::before {
    background: #e74c3c;
}

.feature-card:nth-child(3)::before {
    background: #6c757d;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.feature-card:nth-child(2):hover {
    border-color: #e74c3c;
}

.feature-card:nth-child(3):hover {
    border-color: #6c757d;
}

.feature-card h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 1.2rem;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.feature-card p {
    color: #666;
    line-height: 1.7;
    font-size: 1rem;
    position: relative;
    z-index: 2;
}

.feature-list {
    list-style: none;
    padding: 0;
    position: relative;
    z-index: 2;
}

.feature-list li {
    padding: 0.75rem 0;
    font-size: 1.05rem;
    color: #555;
    position: relative;
    padding-left: 2rem;
    transition: all 0.2s ease;
}

.feature-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0.75rem;
    color: #3498db;
    font-weight: bold;
    font-size: 1.2rem;
}

.feature-list li:hover {
    color: #2c3e50;
    padding-left: 2.2rem;
}

/* Data Engine Section */
.data-engine-section {
    margin-top: 3rem;
}

.data-engine-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #dee2e6;
    border-left: 4px solid #2c3e50;
    position: relative;
}

.data-engine-card h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
}

.data-flow-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.data-flow-item {
    text-align: center;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.data-flow-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.data-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 3rem;
}

.data-icon-img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

.data-flow-item h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.data-flow-item p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.data-flow-arrow {
    font-size: 1.5rem;
    color: #3498db;
    font-weight: bold;
    text-align: center;
}

.data-engine-summary {
    background: rgba(52, 152, 219, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin-top: 2rem;
}

.data-engine-summary p {
    margin: 0;
    font-size: 1.05rem;
    color: #2c3e50;
    line-height: 1.6;
}

.data-engine-summary strong {
    color: #2c3e50;
}

/* =============================================================================
   PROFESSIONAL CONTENT COMPONENTS (for Privacy/Terms pages)
   ============================================================================= */

.professional-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    margin: -10px -10px 2rem -10px;
    border-radius: 0 0 20px 20px;
    border-bottom: 3px solid #3498db;
}

.professional-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.professional-hero p {
    font-size: 1.1rem;
    color: #bdc3c7;
    margin: 0;
}

.professional-content {
    background: #ffffff;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
    margin: 2rem 0;
    line-height: 1.7;
}

.professional-content h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-top: 1.5rem;
    border-top: 2px solid #e9ecef;
    position: relative;
}

.professional-content h3::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #3498db;
}

.professional-content h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.professional-content h3:first-child::before {
    display: none;
}

.professional-content p {
    color: #555;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.professional-content ul {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.professional-content li {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
    padding-left: 2rem;
    position: relative;
}

.professional-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: bold;
    font-size: 1.1rem;
}

.professional-content strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .legend-list { columns: 1; }
}

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
    body { font-size: 12px; }
    .container { width: 100%; padding: 0 5px; box-sizing: border-box; }
    .main-content-area { margin-top: 5px; }

    header { padding: 8px 10px; }
    header .header-content-wrapper { flex-direction: column; align-items: center; }
    header .logo-main-header { margin-bottom: 5px; }
    header .site-title-group-main-header { text-align: center; margin-bottom: 3px;}
    header .site-title-group-main-header h1 { font-size: 1.5em; }
    header .site-title-group-main-header p.tagline-main-header { font-size: 0.75em; }
    header p.contact-info-main-header { text-align: center; font-size: 0.75em; }

    nav.page-navigation { padding: 4px 0; margin-top: 8px; margin-bottom: 8px; }
    nav.page-navigation ul li { margin: 6px 0; }
    nav.page-navigation ul li a.page-nav-link,
    nav.page-navigation ul li button.button-as-link { font-size: 0.85em; padding: 4px 6px; }

    h2.page-section-title { font-size: 1.3em; margin-top: 8px; margin-bottom: 8px; }
    .table-wrapper { max-height: 70vh; }
    table { font-size: 0.8em; }
    th, td { padding: 4px; }

    .legend-container {
        font-size: 0.65em; /* Make it smaller instead of hiding */
        padding: 6px 8px;
        margin-bottom: 10px;
        min-height: 45px; /* Smaller on mobile */
    }

    .loading-state {
        padding: 40px 15px;
        min-height: 200px; /* Smaller on mobile */
    }

    .loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }

    .team-row td.team-name-cell span.team-name-text.hot-streak-text,
    .team-row td.team-name-cell span.team-name-text.cold-streak-text {
        background-color: transparent; color: inherit; padding: 0;
    }
    .table-team-logo { width: 14px; height: 14px;}
    td.team-name-cell { gap: 3px; }
    .view-toggle-container { margin-top: 8px; margin-bottom: 8px; }

    /* About page mobile adjustments */
    .about-hero {
        padding: 3rem 1rem;
        margin: -5px -5px 2rem -5px;
    }

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

    .stat-card {
        padding: 1.2rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .story-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }

    .story-section.reverse .story-content,
    .story-section.reverse .story-media {
        order: unset;
    }

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

    .feature-card {
        padding: 2rem;
    }

    /* Data engine mobile adjustments */
    .data-flow-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .data-flow-arrow {
        display: none !important;
    }

    .data-engine-card {
        padding: 2rem !important;
    }

    /* Professional content mobile adjustments */
    .professional-hero {
        padding: 2rem 1rem;
        margin: -5px -5px 1.5rem -5px;
    }

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

    .professional-content {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    header .site-title-group-main-header h1 { font-size: 1.2em; }
    nav.page-navigation ul li a.page-nav-link,
    nav.page-navigation ul li button.button-as-link { font-size: 0.8em; }
    h2.page-section-title { font-size: 1.1em; }
    #viewDesktopToggleBtn { font-size: 0.7em; padding: 5px 8px;}

    .legend-container {
        min-height: 35px; /* Even smaller on very small screens */
        font-size: 0.6em;
        padding: 4px 6px;
    }

    .loading-state {
        padding: 30px 10px;
        min-height: 150px;
    }

    .loading-spinner {
        width: 25px;
        height: 25px;
        border-width: 2px;
    }

    .about-hero {
        padding: 2rem 1rem;
    }

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

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

    .story-content h3 {
        font-size: 1.5rem;
    }

    .professional-hero h1 {
        font-size: 1.8rem;
    }

    .professional-content {
        padding: 1.5rem;
    }
}

.about-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 2rem 0;
  align-items: flex-start;
}

.about-media, .about-text {
  flex: 1 1 48%;
}

.about-media video {
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  border-radius: 12px;
}

.caption {
  font-size: 0.9rem;
  text-align: center;
  color: #666;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .about-grid {
    flex-direction: column;
  }

  .about-media video {
    max-height: none;
  }
}