/* =========================================
   FIX FOR STATISTICS PANEL HEIGHT AND TABS
   ========================================= */

/* Fix statistics panel height to account for header */
.statistics-panel {
    position: fixed;
    top: 80px !important; /* Start below header */
    right: -500px;
    width: 480px;
    height: calc(100vh - 80px) !important; /* Full height minus header */
    max-height: calc(100vh - 80px) !important;
    background: linear-gradient(180deg, 
                rgba(10, 10, 10, 0.98) 0%, 
                rgba(5, 5, 5, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-left: 3px solid #e10600;
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: hidden; /* Change to hidden, let content handle scrolling */
    overflow-x: hidden;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8),
                -5px 0 30px rgba(225, 6, 0, 0.3);
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Fix statistics content scrolling */
.statistics-content {
    padding: 20px 25px;
    flex: 1;
    overflow-y: auto; /* Enable scrolling here */
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex scrolling */
}

/* Fix stats grid to use available space properly */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    flex: 1;
    min-height: 0;
}

/* Fix stat items to be consistent height */
.stat-item {
    background: linear-gradient(145deg, 
                rgba(20, 20, 20, 0.9) 0%, 
                rgba(25, 25, 25, 0.9) 100%);
    padding: 18px 12px;
    border: 1px solid rgba(225, 6, 0, 0.2);
    border-radius: 6px !important;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    height: auto;
    min-height: 100px;
}

/* Fix toggle buttons spacing */
.stats-toggle {
    display: flex;
    padding: 12px 25px;
    background: rgba(15, 15, 15, 0.9);
    border-bottom: 1px solid rgba(225, 6, 0, 0.2);
    gap: 8px;
    flex-shrink: 0;
}

/* Ensure header doesn't get cut off */
.statistics-header {
    padding: 25px 25px 15px;
    background: linear-gradient(180deg, 
                rgba(20, 20, 20, 0.95) 0%, 
                rgba(15, 15, 15, 0.9) 100%);
    border-bottom: 1px solid rgba(225, 6, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    flex-shrink: 0;
    min-height: 120px;
    margin-top: 0;
}

/* Fix for team container when panel is active */
.teams-container.panel-active {
    width: calc(100% - 480px) !important;
    height: calc(100vh - 80px) !important; /* Match panel height */
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Fix for scroll buttons when panel is active */
.scroll-button.right.panel-active {
    right: 480px !important;
    top: calc(50% + 40px) !important; /* Adjust for header */
}

/* Fix body overflow when panel is active */
body.panel-active {
    overflow: hidden;
}
/* NUCLEAR RESET - NO MARGINS ANYWHERE */
* {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: border-box;
  }
  
  
  html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }
  
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0a0a0a;
    color: white;
    position: relative;
  }
  
  .BODY_PADDING_FIX{
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
  }
  /* Fix for body padding causing bottom gap */
body.BODY_PADDING_FIX {
    padding-top: 80px !important; /* Match the fixed header height */
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
}

#teams {
    height: calc(100vh - 80px); /* Subtract header height */
    margin-top: 0;
}

.teams-container {
    height: 100%; /* Take full height of #teams */
}
  
  /* TEAMS SECTION - NO PADDING */
  #teams {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  
  .section-title {
    text-align: center;
    padding: 40px 0 20px;
    font-size: 3rem;
    background: linear-gradient(90deg, #e10600, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 900;
    flex-shrink: 0;
  }
  
  /* TEAMS CONTAINER - FULL WIDTH */
  .teams-container {
    width: 100%;
    height: calc(100vh - 140px);
    overflow-x: auto;
    overflow-y: hidden;
    background: #0a0a0a;
    position: relative;
    display: flex;
    align-items: flex-end;
    margin: 0;
    padding: 0;
  }
  
  /* Hide scrollbar but keep functionality */
  .teams-container::-webkit-scrollbar {
    display: none;
  }
  
  .teams-container {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  /* TEAMS WRAPPER - TIGHT LAYOUT */
  .teams-wrapper {
    display: flex;
    height: 100%;
    align-items: flex-end;
    padding-left: 50px;
    padding-right: 50px;
    gap: 0;
    width: max-content;
    margin: 0;
  }
  
  /* TEAM CARD - PERFECT WIDTH CONTROL */
  .team-card {
    position: relative;
    height: 85vh;
    width: 280px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    flex-shrink: 0;
    background: transparent;
    transform: scale(0.9);
    filter: grayscale(40%) brightness(0.5);
    transform-origin: center bottom;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: none;
  }
  
  /* TEAM IMAGE CONTAINER */
  .team-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    padding: 0;
  }
  
  /* TEAM CAR IMAGE - MAKE LOGOS FIT CONSISTENTLY - CENTERED */
  .team-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: auto;
    max-height: 65%;
    width: 80%;
    max-width: 200px;
    object-fit: contain;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: grayscale(30%) brightness(0.8);
    z-index: 2;
    margin: 0;
    padding: 0;
  }
  
  /* HOVER EFFECT - SUBTLE ZOOM (NO PULL DOWN) */
  .team-card:hover .team-image {
    filter: grayscale(0%) brightness(1.1);
    transform: translate(-50%, -50%) scale(1.08);
    max-height: 70%;
  }
  
  /* For dark logos like Cadillac, make them brighter */
  .team-card[data-team="cadillac"] .team-image {
    filter: grayscale(30%) brightness(1.2);
  }
  
  .team-card[data-team="cadillac"]:hover .team-image {
    filter: grayscale(0%) brightness(1.4);
    transform: translate(-50%, -50%) scale(1.08);
  }
  
  /* For white logos that need to be visible */
  .team-card[data-team="redbull"] .team-image,
  .team-card[data-team="mercedes"] .team-image,
  .team-card[data-team="audi"] .team-image,
  .team-card[data-team="williams"] .team-image,
  .team-card[data-team="alpine"] .team-image {
    filter: grayscale(30%) brightness(0.9);
  }
  
  .team-card[data-team="redbull"]:hover .team-image,
  .team-card[data-team="mercedes"]:hover .team-image,
  .team-card[data-team="audi"]:hover .team-image,
  .team-card[data-team="williams"]:hover .team-image,
  .team-card[data-team="alpine"]:hover .team-image {
    filter: grayscale(0%) brightness(1.2);
    transform: translate(-50%, -50%) scale(1.08);
  }
  
  /* TEAM NAME LOGO - SINGLE LINE */
  .team-name-logo {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.3rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
    text-align: center;
  }
  
  /* For smaller screens or longer team names, adjust font size */
  @media (max-width: 768px) {
    .team-name-logo {
        font-size: 1rem;
        white-space: normal;
        max-width: 90%;
        line-height: 1.2;
    }
  }
  
  /* Hover effect to keep single line */
  .team-card:hover .team-name-logo {
    opacity: 1;
    transform: translateX(-50%) scale(1.15);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
    white-space: nowrap;
  }
  
  /* TEAM COLOR GRADIENTS - ALL TEAMS */
  .team-card::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.4;
    transition: opacity 0.4s ease;
  }
  
  /* Red Bull gradient */
  .team-card[data-team="redbull"]::before {
    background: linear-gradient(to top, 
        rgba(30, 65, 255, 0.8) 0%,
        rgba(30, 65, 255, 0.6) 30%,
        rgba(30, 65, 255, 0.3) 60%,
        rgba(30, 65, 255, 0.1) 85%,
        transparent 100%);
  }
  
  /* Ferrari gradient */
  .team-card[data-team="ferrari"]::before {
    background: linear-gradient(to top, 
        rgba(255, 0, 0, 0.8) 0%,
        rgba(255, 0, 0, 0.6) 30%,
        rgba(255, 0, 0, 0.3) 60%,
        rgba(255, 0, 0, 0.1) 85%,
        transparent 100%);
  }
  
  /* Mercedes gradient */
  .team-card[data-team="mercedes"]::before {
    background: linear-gradient(to top, 
        rgba(0, 210, 190, 0.8) 0%,
        rgba(0, 210, 190, 0.6) 30%,
        rgba(0, 210, 190, 0.3) 60%,
        rgba(0, 210, 190, 0.1) 85%,
        transparent 100%);
  }
  
  /* Racing Bulls gradient */
  .team-card[data-team="racingbulls"]::before {
    background: linear-gradient(to top, 
        rgba(78, 121, 147, 0.8) 0%,
        rgba(78, 121, 147, 0.6) 30%,
        rgba(78, 121, 147, 0.3) 60%,
        rgba(78, 121, 147, 0.1) 85%,
        transparent 100%);
  }
  
  /* McLaren gradient */
  .team-card[data-team="mclaren"]::before {
    background: linear-gradient(to top, 
        rgba(255, 135, 0, 0.8) 0%,
        rgba(255, 135, 0, 0.6) 30%,
        rgba(255, 135, 0, 0.3) 60%,
        rgba(255, 135, 0, 0.1) 85%,
        transparent 100%);
  }
  
  /* Haas gradient */
  .team-card[data-team="haas"]::before {
    background: linear-gradient(to top, 
        rgba(182, 186, 189, 0.8) 0%,
        rgba(182, 186, 189, 0.6) 30%,
        rgba(182, 186, 189, 0.3) 60%,
        rgba(182, 186, 189, 0.1) 85%,
        transparent 100%);
  }
  
  /* Cadillac gradient */
  .team-card[data-team="cadillac"]::before {
    background: linear-gradient(to top, 
        rgba(70, 29, 124, 0.8) 0%,
        rgba(70, 29, 124, 0.6) 30%,
        rgba(70, 29, 124, 0.3) 60%,
        rgba(70, 29, 124, 0.1) 85%,
        transparent 100%);
  }
  
  /* Williams gradient */
  .team-card[data-team="williams"]::before {
    background: linear-gradient(to top, 
        rgba(0, 90, 255, 0.8) 0%,
        rgba(0, 90, 255, 0.6) 30%,
        rgba(0, 90, 255, 0.3) 60%,
        rgba(0, 90, 255, 0.1) 85%,
        transparent 100%);
  }
  
  /* Audi gradient */
  .team-card[data-team="audi"]::before {
    background: linear-gradient(to top, 
        rgba(255, 60, 0, 0.8) 0%,
        rgba(255, 60, 0, 0.6) 30%,
        rgba(255, 60, 0, 0.3) 60%,
        rgba(255, 60, 0, 0.1) 85%,
        transparent 100%);
  }
  
  /* Aston Martin gradient */
  .team-card[data-team="astonmartin"]::before {
    background: linear-gradient(to top, 
        rgba(0, 111, 98, 0.8) 0%,
        rgba(0, 111, 98, 0.6) 30%,
        rgba(0, 111, 98, 0.3) 60%,
        rgba(0, 111, 98, 0.1) 85%,
        transparent 100%);
  }
  
  /* Alpine gradient */
  .team-card[data-team="alpine"]::before {
    background: linear-gradient(to top, 
        rgba(0, 144, 210, 0.8) 0%,
        rgba(0, 144, 210, 0.6) 30%,
        rgba(0, 144, 210, 0.3) 60%,
        rgba(0, 144, 210, 0.1) 85%,
        transparent 100%);
  }
  
  /* TEAM INFO - PERFECT FIT */
  .team-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    margin: 0;
    padding: 0;
    border: none;
  }
  
  .nametag {
    background: #000000;
    color: white;
    width: 100%;
    margin: 0;
    padding: 20px 15px;
    border: none;
    display: block;
    position: relative;
    left: 0;
    box-sizing: border-box;
    min-width: 100%;
    max-width: 100%;
  }
  
  .team-name {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  .team-principal {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .team-details {
    font-size: 0.9rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
  }
  
  .flag {
    font-size: 1.2rem;
  }
  
  /* HOVER EFFECTS - MAINTAIN CARD SCALE */
  .team-card:hover {
    transform: scale(0.95);
    filter: grayscale(0%) brightness(1);
    width: 300px;
    z-index: 100;
  }
  
  .team-card:hover .team-name-logo {
    opacity: 1;
    transform: translateX(-50%) scale(1.15);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
    white-space: nowrap;
  }
  
  .team-card:hover::before {
    opacity: 0.8;
  }
  
  .team-card:hover .team-info {
    transform: translateY(0);
  }
  
  /* F1 SCROLL BUTTONS */
  .scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 100px;
    background: rgba(10, 10, 10, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
    border: 2px solid #e10600;
    backdrop-filter: blur(8px);
    overflow: hidden;
  }
  
  .scroll-button.left {
    left: 0;
    border-left: none;
    border-radius: 0 30px 30px 0;
    box-shadow: 5px 0 25px rgba(225, 6, 0, 0.3);
    padding-left: 5px;
  }
  
  .scroll-button.right {
    right: 0;
    border-right: none;
    border-radius: 30px 0 0 30px;
    box-shadow: -5px 0 25px rgba(225, 6, 0, 0.3);
    padding-right: 5px;
  }
  
  .scroll-button:hover {
    background: rgba(20, 20, 20, 0.95);
    width: 65px;
    border-color: #ff1a00;
    box-shadow: 0 0 35px rgba(225, 6, 0, 0.5);
  }
  
  .scroll-button:active {
    transform: translateY(-50%) scale(0.98);
  }
  
  .scroll-button::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    border-top: 3px solid white;
    border-right: 3px solid white;
    transition: all 0.2s ease;
  }
  
  .scroll-button.left::before {
    transform: rotate(-135deg);
  }
  
  .scroll-button.right::before {
    transform: rotate(45deg);
  }
  
  .scroll-button:hover::before {
    border-color: #ffffff;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
  }
  
  .scroll-button::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, 
                transparent 30%,
                rgba(225, 6, 0, 0.1) 50%,
                transparent 70%);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
  }
  
  .scroll-button:hover::after {
    opacity: 0.5;
  }
  
  .scroll-button .accent-line {
    position: absolute;
    background: #e10600;
    transition: all 0.3s;
  }
  
  .scroll-button.left .accent-line {
    right: 0;
    top: 25%;
    bottom: 25%;
    width: 2px;
    border-radius: 2px 0 0 2px;
  }
  
  .scroll-button.right .accent-line {
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 2px;
    border-radius: 0 2px 2px 0;
  }
  
  .scroll-button:hover .accent-line {
    background: #ff1a00;
    box-shadow: 0 0 8px #ff1a00;
  }
  
  @keyframes borderPulse {
    0%, 100% {
      border-color: #e10600;
    }
    50% {
      border-color: #ff3333;
    }
  }
  
  .scroll-button {
    animation: borderPulse 4s infinite;
  }
  
  .scroll-button:hover {
    animation: borderPulse 2s infinite;
  }
  
  /* STATISTICS PANEL */
  .statistics-panel {
    position: fixed;
    top: 0;
    right: -500px;
    width: 480px;
    height: 100vh;
    background: linear-gradient(180deg, 
                rgba(10, 10, 10, 0.98) 0%, 
                rgba(5, 5, 5, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-left: 3px solid #e10600;
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8),
                -5px 0 30px rgba(225, 6, 0, 0.3);
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  .statistics-panel.active {
    right: 0;
  }
  
  .teams-container.panel-active {
    width: calc(100% - 480px) !important;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  
  .scroll-button.right.panel-active {
    right: 480px !important;
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  
  .teams-wrapper.panel-active .team-card:not(.selected) {
    transform: scale(0.85) !important;
    filter: grayscale(60%) brightness(0.4) !important;
    opacity: 0.7;
    pointer-events: auto !important;
  }
  
  .teams-container.panel-active .team-card {
    pointer-events: auto !important;
    cursor: pointer !important;
  }
  
  .teams-wrapper.panel-active .team-card:not(.selected):hover .team-info {
    transform: translateY(0) !important;
  }
  
  /* Close button */
  .close-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #e10600;
    color: white;
    border: none;
    border-radius: 50% !important;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.8);
  }
  
  .close-panel:hover {
    background: #ff1a00;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 26, 0, 1);
  }
  
  /* Statistics Header */
  .statistics-header {
    padding: 25px 25px 15px;
    background: linear-gradient(180deg, 
                rgba(20, 20, 20, 0.95) 0%, 
                rgba(15, 15, 15, 0.9) 100%);
    border-bottom: 1px solid rgba(225, 6, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    flex-shrink: 0;
    min-height: 120px;
  }
  
  .stats-image-container {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
  }
  
  .glow-effect {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle at center, 
                rgba(225, 6, 0, 0.4) 0%, 
                transparent 70%);
    z-index: 0;
    filter: blur(10px);
    animation: imageGlow 4s infinite alternate;
  }
  
  @keyframes imageGlow {
    0% {
      opacity: 0.5;
      transform: scale(1);
    }
    100% {
      opacity: 0.8;
      transform: scale(1.05);
    }
  }
  
  .stats-team-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(225, 6, 0, 0.6));
    position: relative;
    z-index: 1;
  }
  
  .stats-team-info {
    flex: 1;
    min-width: 0;
  }
  
  .stats-team-info h2 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 4px;
    text-transform: uppercase;
    color: white;
    text-shadow: 0 2px 10px rgba(225, 6, 0, 0.3);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .stats-team-info p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 6px;
    color: #e10600;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .stats-team-nationality {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    opacity: 0.7;
    color: #ccc;
  }
  
  .stats-team-nationality span:first-child {
    font-size: 1.1rem;
  }
  
  /* Stats Toggle */
  .stats-toggle {
    display: flex;
    padding: 12px 25px;
    background: rgba(15, 15, 15, 0.9);
    border-bottom: 1px solid rgba(225, 6, 0, 0.2);
    gap: 8px;
    flex-shrink: 0;
  }
  
  .toggle-btn {
    flex: 1;
    padding: 10px 12px;
    background: rgba(25, 25, 25, 0.9);
    color: #888;
    border: 1px solid rgba(225, 6, 0, 0.3);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
  }
  
  .toggle-btn.active {
    background: linear-gradient(135deg, #e10600 0%, #ff1a00 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(225, 6, 0, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  
  .toggle-btn:hover:not(.active) {
    background: rgba(225, 6, 0, 0.15);
    color: white;
    border-color: rgba(225, 6, 0, 0.5);
  }
  
  .toggle-btn .toggle-glow {
    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 ease;
  }
  
  .toggle-btn:hover .toggle-glow {
    left: 100%;
  }
  
  .toggle-text {
    position: relative;
    z-index: 2;
  }
  
  /* Statistics Content */
  .statistics-content {
    padding: 20px 25px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
    flex: 1;
    min-height: 0;
  }
  
  .stat-item {
    background: linear-gradient(145deg, 
                rgba(20, 20, 20, 0.9) 0%, 
                rgba(25, 25, 25, 0.9) 100%);
    padding: 18px 12px;
    border: 1px solid rgba(225, 6, 0, 0.2);
    border-radius: 6px !important;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    min-height: 100px;
  }
  
  .stat-item:hover {
    background: linear-gradient(145deg, 
                rgba(30, 30, 30, 0.95) 0%, 
                rgba(35, 35, 35, 0.95) 100%);
    transform: translateY(-3px);
    border-color: #ff1a00;
    box-shadow: 0 6px 20px rgba(225, 6, 0, 0.3),
                0 0 15px rgba(225, 6, 0, 0.2);
  }
  
  .stat-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
                transparent 20%, 
                rgba(225, 6, 0, 0.1) 50%, 
                transparent 80%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
  }
  
  .stat-item:hover .stat-glow {
    opacity: 1;
  }
  
  .stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    font-weight: 600;
  }
  
  .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: white;
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    line-height: 1;
  }
  
  .stat-item:hover .stat-value {
    color: #fff;
    text-shadow: 0 0 8px rgba(225, 6, 0, 0.6),
                 0 0 15px rgba(225, 6, 0, 0.3);
  }
  
  @keyframes panelGlow {
    0%, 100% {
      border-left-color: #e10600;
      box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8),
                  -5px 0 30px rgba(225, 6, 0, 0.3);
    }
    50% {
      border-left-color: #ff1a00;
      box-shadow: -10px 0 60px rgba(0, 0, 0, 0.9),
                  -5px 0 40px rgba(225, 6, 0, 0.5);
    }
  }
  
  .statistics-panel.active {
    animation: panelGlow 3s infinite;
  }
  
  /* Custom scrollbar */
  .statistics-panel::-webkit-scrollbar {
    width: 6px;
  }
  
  .statistics-panel::-webkit-scrollbar-track {
    background: rgba(15, 15, 15, 0.3);
  }
  
  .statistics-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, 
                #e10600, 
                #ff1a00);
    border-radius: 3px;
  }
  
  .statistics-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, 
                #ff1a00, 
                #ff3333);
  }
  
  /* SELECTED TEAM HIGHLIGHT */
  .team-card.selected {
    transform: scale(0.95) !important;
    filter: grayscale(0%) brightness(1) !important;
    width: 300px !important;
    z-index: 100 !important;
  }
  
  .team-card.selected .team-image {
    filter: grayscale(0%) brightness(1.1) !important;
    transform: translate(-50%, -50%) scale(1.08) !important;
    max-height: 70% !important;
  }
  
  .team-card.selected .team-name-logo {
    opacity: 1 !important;
    transform: translateX(-50%) scale(1.15) !important;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.7) !important;
    white-space: nowrap !important;
  }
  
  .team-card.selected::before {
    opacity: 0.8 !important;
  }
  
  .team-card.selected .team-info {
    transform: translateY(0) !important;
  }
  
  .team-card.selected::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid rgba(225, 6, 0, 0.6);
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
    animation: selectedBorderGlow 2s infinite alternate;
  }
  
  @keyframes selectedBorderGlow {
    0% {
      border-color: rgba(225, 6, 0, 0.4);
      box-shadow: 0 0 10px rgba(225, 6, 0, 0.2);
    }
    100% {
      border-color: rgba(225, 6, 0, 0.8);
      box-shadow: 0 0 20px rgba(225, 6, 0, 0.4);
    }
  }
  
  .team-card.selected .team-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
      ellipse at center,
      rgba(225, 6, 0, 0.15) 0%,
      transparent 70%
    );
    z-index: 4;
    opacity: 0.5;
    pointer-events: none;
  }
  
  /* Team-specific gradients for selected state */
  .team-card.selected[data-team="redbull"]::before {
    background: linear-gradient(to top, 
        rgba(30, 65, 255, 0.8) 0%,
        rgba(30, 65, 255, 0.6) 30%,
        rgba(30, 65, 255, 0.3) 60%,
        rgba(30, 65, 255, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="ferrari"]::before {
    background: linear-gradient(to top, 
        rgba(255, 0, 0, 0.8) 0%,
        rgba(255, 0, 0, 0.6) 30%,
        rgba(255, 0, 0, 0.3) 60%,
        rgba(255, 0, 0, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="mercedes"]::before {
    background: linear-gradient(to top, 
        rgba(0, 210, 190, 0.8) 0%,
        rgba(0, 210, 190, 0.6) 30%,
        rgba(0, 210, 190, 0.3) 60%,
        rgba(0, 210, 190, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="mclaren"]::before {
    background: linear-gradient(to top, 
        rgba(255, 135, 0, 0.8) 0%,
        rgba(255, 135, 0, 0.6) 30%,
        rgba(255, 135, 0, 0.3) 60%,
        rgba(255, 135, 0, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="astonmartin"]::before {
    background: linear-gradient(to top, 
        rgba(0, 111, 98, 0.8) 0%,
        rgba(0, 111, 98, 0.6) 30%,
        rgba(0, 111, 98, 0.3) 60%,
        rgba(0, 111, 98, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="alpine"]::before {
    background: linear-gradient(to top, 
        rgba(0, 144, 210, 0.8) 0%,
        rgba(0, 144, 210, 0.6) 30%,
        rgba(0, 144, 210, 0.3) 60%,
        rgba(0, 144, 210, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="williams"]::before {
    background: linear-gradient(to top, 
        rgba(0, 90, 255, 0.8) 0%,
        rgba(0, 90, 255, 0.6) 30%,
        rgba(0, 90, 255, 0.3) 60%,
        rgba(0, 90, 255, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="racingbulls"]::before {
    background: linear-gradient(to top, 
        rgba(78, 121, 147, 0.8) 0%,
        rgba(78, 121, 147, 0.6) 30%,
        rgba(78, 121, 147, 0.3) 60%,
        rgba(78, 121, 147, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="haas"]::before {
    background: linear-gradient(to top, 
        rgba(182, 186, 189, 0.8) 0%,
        rgba(182, 186, 189, 0.6) 30%,
        rgba(182, 186, 189, 0.3) 60%,
        rgba(182, 186, 189, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="audi"]::before {
    background: linear-gradient(to top, 
        rgba(255, 60, 0, 0.8) 0%,
        rgba(255, 60, 0, 0.6) 30%,
        rgba(255, 60, 0, 0.3) 60%,
        rgba(255, 60, 0, 0.1) 85%,
        transparent 100%) !important;
  }
  
  .team-card.selected[data-team="cadillac"]::before {
    background: linear-gradient(to top, 
        rgba(70, 29, 124, 0.8) 0%,
        rgba(70, 29, 124, 0.6) 30%,
        rgba(70, 29, 124, 0.3) 60%,
        rgba(70, 29, 124, 0.1) 85%,
        transparent 100%) !important;
  }
  
  /* Scroll button visibility when panel is active */
  .scroll-button.panel-active {
    z-index: 10001 !important;
    pointer-events: all !important;
  }
  
  .scroll-button.right.panel-active {
    right: 480px !important;
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  
  .scroll-button.panel-active {
    background: rgba(20, 20, 20, 0.95);
    border-color: #ff1a00;
    box-shadow: 0 0 35px rgba(225, 6, 0, 0.6);
  }
  
  /* Fix for unselected teams when panel is open */
  .teams-wrapper.panel-active .team-card:not(.selected) {
    transform: scale(0.85) !important;
    filter: grayscale(60%) brightness(0.4) !important;
    opacity: 0.7;
    pointer-events: none;
  }