:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2c2c2c;
    --accent-color: #ff4d4d;
    --navbar-offset: 96px;
    --text-color: #ffffff;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global Loading Spinner Overlay */
.global-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.global-spinner-overlay.show {
    display: flex;
}

.global-spinner-container {
    text-align: center;
    background-color: rgba(26, 26, 26, 0.95);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.global-spinner {
    border: 6px solid #444;
    border-top: 6px solid #ffffff;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: global-spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.global-spinner-text {
    color: #ffffff;
    font-size: 1.3em;
    font-weight: 500;
    margin: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--primary-color);
}

/* Home page black overlay effect - covers EVERYTHING on home page only */
main.home-page-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 999;
    transition: opacity 0.3s ease;
}

/* Hide overlay when mobile menu is open */
main.home-page-overlay.menu-open::before {
    opacity: 0;
    visibility: hidden;
}

main.home-page-overlay {
    position: relative;
}

/* Ensure leaderboard section isn't accidentally hidden */
#mlb-leaderboard-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    padding: 96px 32px 40px;
    box-sizing: border-box;
    min-height: 100vh;
    overflow: visible !important;
}

/* Ensure sections only grow with content */
/* Keep sections tight under the fixed navbar */
main > section:not(#hero) {
    min-height: auto !important;
    padding: 24px 20px !important; /* override inline 80px top padding */
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #1a1a1a;
    padding: 0.5rem 0; /* tighter so items fit */
    z-index: 9999;
}

.nav-container {
    width: 100%;
    max-width: none; /* let it span the full header */
    margin: 0;       /* no centering offset */
    display: flex;
    justify-content: space-between; /* logo on left, report button on right */
    align-items: center;
    padding: 0 1rem; /* padding on both sides */
    gap: 1rem; /* space between logo and links */
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    flex: 0 0 auto;
}

.logo img {
    height: clamp(28px, 3.2vw, 40px);
    vertical-align: middle;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem 0.75rem; /* compact spacing */
    flex-wrap: nowrap; /* keep on one line */
    flex: 1 1 auto;
    justify-content: flex-start; /* sit next to logo */
    min-width: 0;
}

.nav-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.logout-button {
    font-weight: 600;
    cursor: pointer;
}

.nav-actions .logout-button {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    padding: clamp(0.35rem, 0.7vw, 0.5rem) clamp(0.8rem, 1.4vw, 1.4rem);
    border-radius: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-actions .logout-button:hover,
.nav-actions .logout-button:focus-visible {
    background-color: var(--text-color);
    color: var(--primary-color);
    outline: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: clamp(0.25rem, 0.6vw, 0.5rem) clamp(0.5rem, 1vw, 1rem);
    transition: color 0.3s ease;
    font-size: clamp(12px, 1.05vw, 16px); /* scale text for fit */
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
}

.nav-links a.cta-button {
    background-color: var(--accent-color);
    color: white;
    padding: clamp(0.35rem, 0.6vw, 0.5rem) clamp(0.9rem, 1.4vw, 1.5rem);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-links a.cta-button:hover {
    background-color: var(--accent-hover-color);
    color: white;
}

/* Report Button Styles */
.report-button {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.report-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.report-button:hover {
    background: linear-gradient(135deg, #ff5252, #ff7979);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    color: white !important;
}

.report-button:hover::before {
    left: 100%;
}

.report-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(26, 26, 26, 0.98);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    border-radius: 4px;
    border: 1px solid #444;
    top: 100%;
    left: 0;
}

/* Ensure dropdown menu positions relative to its trigger */
.dropdown {
    position: relative;
}

/* Keep the trigger inline-sized and not stretching in flex */
.dropdown > a {
    display: inline-block;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #444;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #2a2a2a;
    color: var(--accent-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Highlight the trigger when its menu is open */
.dropdown:hover > a {
    color: var(--accent-color);
}

.cta-button {
    background-color: var(--accent-color);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
}

.cta-button:hover {
    background-color: #ff3333;
    color: var(--text-color) !important;
}

/* Hero Section */
.hero {
    height: 100vh;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
}

/* Golden glow behind the image */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 1;
    pointer-events: none;
}

/* Throwing man image layer */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('throwing_man.png') center/50% no-repeat;
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1001;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--light-gray);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.primary-button, .secondary-button {
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.primary-button {
    background-color: var(--accent-color);
    color: var(--text-color);
}

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

.primary-button:hover {
    background-color: #ff3333;
}

.secondary-button:hover {
    background-color: var(--text-color);
    color: var(--primary-color);
}

/* Stats Section */
.stats-section {
    background-color: var(--secondary-color);
    padding: 4rem 0;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 0 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    background-color: var(--primary-color);
}

.features h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

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

.feature-card {
    background-color: var(--secondary-color);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
}

/* Testimonials Section */
.testimonials {
    background-color: var(--secondary-color);
    padding: 6rem 2rem;
    text-align: center;
}

.testimonials h2 {
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.testimonial {
    max-width: 800px;
    margin: 0 auto;
    font-style: italic;
}

.testimonial p {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    padding: 4rem 2rem 2rem;
}

/* Filter Grids */
.count-filter-grid,
.zone-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 1rem;
}

.count-filter-grid label,
.zone-filter-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.count-filter-grid input[type="checkbox"],
.zone-filter-grid input[type="checkbox"] {
    margin: 0;
}

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

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

.footer-section a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    font-size: 1.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10002;
    position: relative;
}

.mobile-menu-toggle:hover {
    color: var(--accent-color);
}

/* Mobile menu backdrop overlay */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: var(--navbar-offset, 60px);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Design - Hamburger menu activates at 1100px for better zoom support */
@media (max-width: 1100px) {
    .mobile-menu-toggle {
        display: block;
    }

    .navbar {
        padding: 0.75rem 0;
    }

    .nav-container {
        padding: 0 0.75rem;
    }

    .logo img {
        height: clamp(24px, 6vw, 32px) !important;
    }

    .nav-links {
        position: fixed;
        top: var(--navbar-offset, 60px);
        left: 0;
        right: 0;
        width: 100%;
        max-height: 0;
        background-color: #1a1a1a;
        flex-direction: column;
        align-items: center;
        padding: 0;
        transition: max-height 0.4s ease, padding 0.4s ease;
        overflow: hidden;
        z-index: 10001 !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
        pointer-events: none !important;
        visibility: hidden;
    }

    .nav-links.active {
        max-height: calc(100vh - var(--navbar-offset, 60px));
        padding: 1rem 0;
        overflow-y: auto;
        pointer-events: auto !important;
        visibility: visible;
    }

    .nav-links a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #333;
        font-size: 16px !important;
        transition: background-color 0.2s ease, color 0.2s ease;
        text-align: center;
        width: 100%;
        max-width: 400px;
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative;
        z-index: 1;
    }

    .nav-links a:hover {
        background-color: rgba(255, 77, 77, 0.1);
    }

    .dropdown {
        width: 100%;
        max-width: 400px;
        pointer-events: auto !important;
    }

    .dropdown > a {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    .dropdown > a::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        right: 1.5rem;
        transition: transform 0.3s ease;
    }

    .dropdown.active > a::after {
        transform: rotate(180deg);
    }

    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background-color: #2c2c2c;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        pointer-events: auto !important;
    }

    .dropdown.active .dropdown-content {
        display: block;
        max-height: 500px;
        pointer-events: auto !important;
    }

    .dropdown-content a {
        padding: 0.75rem 2rem;
        font-size: 14px;
        transition: background-color 0.2s ease;
        text-align: center;
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    .dropdown-content a:hover {
        background-color: rgba(255, 77, 77, 0.15);
    }

    /* Hide nav-actions in header, show in mobile menu */
    .nav-actions {
        display: none !important;
    }

    /* Mobile menu actions section */
    .mobile-menu-actions {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.5rem;
        border-top: 2px solid #444;
        margin-top: 1rem;
        width: 100%;
        max-width: 400px;
        align-items: center;
        pointer-events: auto;
    }

    .mobile-menu-actions .report-button,
    .mobile-menu-actions .logout-button {
        width: 100%;
        max-width: 350px;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 14px;
        pointer-events: auto;
        cursor: pointer;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-buttons {
        flex-direction: column;
    }
}

/* Hide mobile menu actions on desktop */
.mobile-menu-actions {
    display: none;
}

/* Slightly reduce spacing on large screens before hamburger menu kicks in */
@media (max-width: 1350px) and (min-width: 1101px) {
    .nav-links {
        gap: 0.25rem 0.5rem;
    }

    .nav-links a {
        font-size: clamp(12px, 1.1vw, 15px);
        padding: clamp(0.3rem, 0.6vw, 0.5rem) clamp(0.5rem, 0.9vw, 0.9rem);
    }

    .report-button {
        font-size: clamp(12px, 1.2vw, 14px);
        padding: clamp(0.5rem, 0.9vw, 0.6rem) clamp(0.9rem, 1.3vw, 1.1rem);
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.5rem;
    }

    .logo img {
        height: clamp(20px, 5vw, 28px) !important;
    }

    .mobile-menu-toggle {
        font-size: 1.25rem;
        padding: 0.35rem;
    }

    .nav-links a {
        padding: 0.875rem 1rem;
        font-size: 15px !important;
        text-align: center;
    }

    .dropdown-content a {
        padding: 0.75rem 1.5rem;
        font-size: 13px !important;
        text-align: center;
    }

    .mobile-menu-actions {
        padding: 1rem;
        max-width: 100%;
    }

    .mobile-menu-actions .report-button,
    .mobile-menu-actions .logout-button {
        font-size: 13px;
        padding: 0.65rem 0.875rem;
        max-width: 100%;
    }

    .dropdown {
        max-width: 100%;
    }
}

/* Support for browser zoom */
@media (min-resolution: 1.5dppx) {
    .nav-links a {
        font-size: clamp(11px, 1vw, 15px);
    }
}

/* Ensure touch targets are large enough on mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-links a,
    .dropdown-content a {
        padding: 1rem 1.5rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Clean title styling with lines meeting in the middle */
.clean-title {
    position: relative;
    text-align: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 5px 0;
    padding: 0 40px;
}

.clean-title::before,
.clean-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 200px;
    height: 2px;
    background-color: #ffffff;
}

.clean-title::before {
    left: 0;
    transform: translateY(-50%);
}

.clean-title::after {
    right: 0;
    transform: translateY(-50%);
} 

/* Generic clean inputs/cards/table for new components */
.clean-input {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 10px;
}

.clean-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
}

.clean-table {
    width: 100%;
    border-collapse: collapse;
}
.clean-table th, .clean-table td {
    border: 1px solid #333;
    padding: 6px 8px;
    color: #ddd;
}
.clean-table th {
    background: #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Leaderboard filter toolbar */
.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-end;
    margin: 12px 0 20px 0;
}
.filter-toolbar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-toolbar label { color: #ddd; font-size: 12px; }
.btn { background:#2a2a2a; color:#eee; border:1px solid #444; padding:8px 12px; border-radius:6px; cursor:pointer; }
.btn:hover { background:#333; }
.btn-primary { background:#ff4d4d; border-color:#ff4d4d; color:#fff; }
.btn-primary:hover { background:#ff3333; }
.switch { display:flex; align-items:center; gap:8px; color:#ddd; }

/* Pitch Trajectory Styles */
.trajectory-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    gap: 32px;
    margin: 0 auto;
}

.trajectory-controls {
    background-color: var(--secondary-color);
    border-radius: 14px;
    padding: 22px 20px 24px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 480px;
    margin: 0 auto;
}

.trajectory-controls h3 {
    color: var(--text-color);
    margin-bottom: 4px;
    font-size: 20px;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 12px;
}

.trajectory-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trajectory-controls label {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.trajectory-controls select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: var(--text-color);
    font-size: 15px;
}

.trajectory-controls select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

.control-pitcher-search--expanded {
    align-items: center;
}

.control-pitcher-search--expanded .trajectory-search-bar {
    width: min(100%, 640px);
    display: block;
    margin: 0 auto;
}

.trajectory-search-bar {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.trajectory-search-bar input {
    width: 100%;
    padding: 18px 22px;
    font-size: 18px;
    border-radius: 10px;
    border: 1px solid #3d3d3d;
    background-color: #1f1f1f;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.trajectory-search-bar input::placeholder {
    color: #9c9c9c;
    text-align: center;
}

.trajectory-search-bar .suggestion-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f1f1f;
    border: 1px solid #3d3d3d;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 15;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.trajectory-search-bar .suggestion-item {
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid #2c2c2c;
    color: #f2f2f2;
    font-size: 16px;
}

.trajectory-search-bar .suggestion-item:last-child {
    border-bottom: none;
}

.trajectory-search-bar .suggestion-item:hover {
    background: rgba(212, 175, 55, 0.2);
}

.control-year--stacked {
    align-items: center;
    justify-content: center;
    width: 100%;
}

.control-year--stacked select {
    width: min(220px, 100%);
    text-align: center;
}

.trajectory-secondary-controls {
    margin-top: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.trajectory-options-group {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid #d4af37;
    background: rgba(18, 18, 18, 0.92);
    cursor: pointer;
    gap: 7px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.options-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: #d4af37;
    border-radius: 2px;
}

.options-toggle:hover {
    background: rgba(212, 175, 55, 0.18);
    transform: translateY(-2px);
}

.options-toggle:focus {
    outline: 2px solid #d4af37;
    outline-offset: 3px;
}

.options-toggle[aria-expanded="true"] {
    background: rgba(212, 175, 55, 0.24);
}



.trajectory-options-panel {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(32, 32, 32, 0.96);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
    display: none;
    width: min(360px, 85vw);
    border: 1px solid rgba(212, 175, 55, 0.25);
    z-index: 25;
}

.trajectory-options-panel .options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.trajectory-options-panel .control-group {
    width: 100%;
}

.trajectory-plot-area {
    width: 100%;
    padding: 10px 0 60px;
    display: flex;
    justify-content: center;
    align-items: center; /* Added for vertical centering */
    min-height: 70vh;    /* Ensures enough height for centering */
    background-color: #0e0e0e;
}

#trajectory-plot {
    width: 100%;
    max-width: min(1400px, 98vw);
    min-height: 68vh;
    height: 68vh;
    border: 1px solid #333;
    border-radius: 12px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}

#trajectory-plot > div {
    width: 100% !important;
    height: 100% !important;
}

#trajectory-plot .plotly,
#trajectory-plot .plot-container,
#trajectory-plot .svg-container {
    height: 100% !important;
    width: 100% !important;
    background: transparent;
}

#trajectory-plot .svg-container {
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
}

#trajectory-plot .gl-container,
#trajectory-plot .gl-container > * {
    margin: 0 auto !important;
}

#trajectory-plot .plot-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

@media (max-width: 768px) {
    .trajectory-controls {
        padding: 24px 20px 28px;
        gap: 18px;
    }

    .control-pitcher-search--expanded .trajectory-search-bar {
        width: 100%;
    }

    .trajectory-secondary-controls {
        flex-direction: column;
        align-items: center;
    }

    .trajectory-options-panel {
        left: 50%;
        transform: translateX(-50%);
    }

    #trajectory-plot {
        min-height: 55vh;
    }
}
