/* =========================================
   🏁 FORMULA 1 DESIGN SYSTEM (2026 Spec)
   ========================================= */

/* --- 1. FONTS & RESETS --- */
@font-face {
    font-family: 'Formula1-Regular';
    src: url('Formula1-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Formula1-Bold';
    src: url('Formula1-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TitilliumWeb-Bold';
    src: url('TitilliumWeb-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    --f1-red: #E10600;
    /* Official F1 Red */
    --f1-dark: #15151E;
    /* Carbon Black */
    --f1-black: #000000;
    /* Pure Black */
    --f1-white: #F0F0F0;
    /* Off-White */
    --f1-gray: #38383F;
    /* UI Gray */
    --f1-slant: -20deg;
    /* Signature Skew Angle */
}

body {
    font-family: 'Titillium Web', 'Formula1-Regular', sans-serif;
    background-color: var(--f1-dark);
    color: var(--f1-white);
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Formula1-Bold', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- 2. HEADER & NAVIGATION --- */
.main-header {
    background-color: var(--f1-dark);
    border-bottom: 4px solid var(--f1-red);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 80px;
    /* Taller header for impact */
}

/* FIX: Force Header Logo Size */
.top-nav img {
    height: 48px;
    width: auto;
}

/* Navigation Links */
#main-nav-links {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
}

#main-nav-links a {
    position: relative;
    color: var(--f1-white);
    text-transform: uppercase;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.2s ease-out;
}

#main-nav-links a:hover {
    color: var(--f1-red);
}

/* F1 Style Slanted Dividers */
#main-nav-links a:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 30%;
    height: 40%;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    transform: skewX(var(--f1-slant));
}

/* --- 3. BUTTONS --- */
#sign-in-btn,
.action-btn {
    background-color: transparent;
    border: 2px solid var(--f1-white);
    color: var(--f1-white);
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#sign-in-btn:hover,
.action-btn:hover {
    background-color: var(--f1-red);
    border-color: var(--f1-red);
    color: var(--f1-white);
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.3);
}

#user-menu-button {
    color: #9CA3AF;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#user-menu-button:hover,
#user-menu-button.active {
    color: var(--f1-white);
    border-color: var(--f1-gray);
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- 4. MATCHUP CARDS & LOGOS --- */
.matchup-card {
    background-color: #1F1F27;
    border-radius: 8px 8px 0 0;
    border-top: 4px solid transparent;
    border-right: 1px solid #2A2A35;
    border-bottom: 1px solid #2A2A35;
    transition: transform 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.matchup-card:hover {
    transform: translateY(-4px);
    border-top-color: var(--f1-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* FIX: Strict Team Logo Containment */
/* This stops the SVG from exploding */
.team-logo-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Cuts off anything outside circle */
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 auto;
    background-color: #2A2A35;
    position: relative;
    z-index: 10;
}

.team-logo {
    width: 65% !important;
    /* Force logo to fit inside container */
    height: 65% !important;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Text Fixes */
.text-2xl.font-bold.text-gray-600 {
    color: var(--f1-gray) !important;
    font-family: 'Formula1-Regular', sans-serif;
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Specific Border Colors */
.game-to-watch {
    border: 2px solid #F49902 !important;
}

.upset-alert {
    border: 2px solid var(--f1-red) !important;
}

.pick-bar {
    border-radius: 0 4px 4px 0;
}

/* --- 5. LEADERBOARD & NEWS --- */
#live-ticker-container {
    background-color: var(--f1-black);
    border-bottom: 1px solid var(--f1-gray);
    height: 40px;
    display: flex;
    align-items: center;
}

#live-ticker span {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#featured-article-link {
    border-right: 6px solid var(--f1-red);
    border-radius: 8px 0 0 8px;
    transition: transform 0.2s;
}

#featured-article-link:hover {
    transform: scale(1.01);
}

#podium-container>div {
    background-color: #1F1F27;
    border: 1px solid #2A2A35;
    border-radius: 8px;
    padding: 1.5rem;
}

#news-container a {
    border-radius: 8px;
    border: 1px solid #2A2A35;
    background-color: #1F1F27;
    transition: border-color 0.2s;
}

#news-container a:hover {
    border-color: var(--f1-red);
}

.news-card-content {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    color: #CCCCCC;
}

/* --- 6. UTILITIES --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--f1-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--f1-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--f1-red);
}

.bg-pattern {
    background-image: radial-gradient(#2A2A35 1px, transparent 1px);
    background-size: 10px 10px;
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.skeleton {
    background: #1a1a1a linear-gradient(to right, #1a1a1a 8%, #222 18%, #1a1a1a 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
}

/* F1 Fastest Lap / Perfect Week Glow */
.perfect-week-glow {
    position: relative;
    outline: 2px solid var(--f1-purple);
    box-shadow: inset 0 0 15px rgba(182, 36, 255, 0.2), 0 0 15px rgba(182, 36, 255, 0.2);
}

/* Subtle indicator on the side of the row */
.perfect-week-glow::after {
    content: 'PERFECT WEEK';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    font-weight: 900;
    color: var(--f1-purple);
    letter-spacing: 0.1em;
}