/* =========================================
   RESC DRIVERS PORTAL STYLES (Simracing Theme)
   ========================================= */

body {
    background-color: #0B101E !important; 
}

#resc_drivers_content {
    padding: 120px 4rem 4rem 4rem; 
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: 80vh;
}

.view-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Directory Header --- */
.directory_header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid rgba(42, 86, 255, 0.2);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.accent-blue { color: var(--accent-sim); }
.page-subtitle { color: var(--text-muted); font-size: 1.1rem; }

.directory_controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.select_wrapper { position: relative; }
.custom_select {
    appearance: none; background-color: #151C2D; color: var(--text-main);
    border: 1px solid rgba(42, 86, 255, 0.3); padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: 6px; font-family: var(--font-heading); font-size: 0.9rem;
    cursor: pointer; transition: border-color 0.3s;
}
.custom_select:focus { outline: none; border-color: var(--accent-sim); }
.select_wrapper::after { content: '▼'; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 0.7rem; pointer-events: none; color: var(--text-muted); }

/* --- Drivers Grid (Trading Cards Style) --- */
.drivers-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.driver-card {
    position: relative;
    background-color: #151C2D;
    border: 1px solid rgba(42, 86, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.driver-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-sim);
    box-shadow: 0 10px 25px rgba(42, 86, 255, 0.2);
}

.card-visual-zone {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #1a233a 0%, #0B101E 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-bottom: 2px solid var(--accent-sim);
}

.bg-number {
    position: absolute;
    top: -20px;
    right: -10px;
    font-family: var(--font-heading);
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.03);
    z-index: 1;
    pointer-events: none;
}

.card-car-img {
    position: relative;
    z-index: 2;
    width: 90%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
}

.card-info-zone {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.driver-cat-pill {
    align-self: flex-start;
    background-color: rgba(42, 86, 255, 0.15);
    color: var(--accent-sim);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.driver-name { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 0.3rem; }
.driver-team { color: var(--text-muted); font-size: 0.9rem; font-weight: bold; margin-bottom: 1rem; }
.driver-seasons { font-size: 0.8rem; color: #888; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 0.8rem; }
.driver-seasons span { color: var(--text-main); font-weight: bold; }

/* --- Detailed Driver Profile Dashboard --- */
.btn-back {
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(21, 28, 45, 0.85);
    border: 1px solid rgba(42, 86, 255, 0.35);
    color: var(--text-main);
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    cursor: pointer;
}

.btn-back:hover {
    background: rgba(42, 86, 255, 0.2);
    border-color: #2a56ff;
    color: #fff;
    transform: translateX(-4px);
    box-shadow: 0 0 15px rgba(42, 86, 255, 0.35);
}

.btn-back:active {
    transform: translateX(-2px);
}

.profile-dashboard {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

/* Left Column: Hero & Bio */
.profile-main-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-hero {
    position: relative;
    background-color: #151C2D;
    border: 1px solid rgba(42, 86, 255, 0.3);
    border-radius: 12px;
    padding: 3rem;
    overflow: hidden;
}

.hero-bg-number {
    position: absolute;
    top: -30px;
    right: -20px;
    font-family: var(--font-heading);
    font-size: 15rem;
    color: rgba(42, 86, 255, 0.05);
    z-index: 1;
    line-height: 1;
}

.hero-content { position: relative; z-index: 2; }
.hero-driver-name { font-family: var(--font-heading); font-size: 3.5rem; text-transform: uppercase; margin-bottom: 0.5rem; }
.hero-team-name { font-size: 1.5rem; color: var(--accent-sim); font-weight: bold; margin-bottom: 2rem; }
.hero-car-img { width: 100%; max-width: 500px; height: auto; filter: drop-shadow(0 15px 20px rgba(0,0,0,0.6)); }

.profile-bio {
    background-color: #151C2D;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 2rem;
}
.profile-section-title { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 1rem; color: var(--text-main); border-bottom: 2px solid var(--accent-sim); padding-bottom: 0.5rem; display: inline-block; }
.profile-bio p { color: var(--text-muted); line-height: 1.7; font-size: 1rem; }
.title-padding{padding-top:1rem;}

/* Right Column: Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.stat-box-compact {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.stat-box-compact:hover {
    background-color: rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

.stat-box-compact.highlight-box {
    background-color: rgba(42, 86, 255, 0.05);
    border-color: rgba(42, 86, 255, 0.2);
}

.stat-box-compact.highlight-gold-box {
    background-color: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.2);
}

.stat-box-compact .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.stat-value { font-family: var(--font-heading); font-size: 1.5rem; color: var(--text-main); }
.stat-value.highlight { color: var(--accent-sim); font-size: 1.8rem; }
.stat-value.highlight-gold { color: #FFD700; font-size: 1.8rem; text-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }

/* --- Mobile Responsiveness (Strict Containment) --- */
@media (max-width: 899px) {
    #resc_drivers_content { 
        padding: 9rem 1rem 2rem 1rem; 
        box-sizing: border-box;
    }
    
    .directory_header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1.5rem; 
    }
    
    .directory_controls { width: 100%; flex-direction: column; align-items: stretch; }
    .select_wrapper, .custom_select { width: 100%; box-sizing: border-box; }

    /* Dashboard Layout becomes stacked */
    .profile-dashboard {
        grid-template-columns: 1fr;
    }
    
    .profile-hero { padding: 1.5rem; }
    .hero-driver-name { font-size: 2rem; word-wrap: break-word; overflow-wrap: break-word; line-height: 1.1; }
    .hero-team-name { font-size: 1.2rem; }
    .hero-bg-number { font-size: 8rem; top: -10px; right: -10px; }
    
    .stats-card, .profile-bio { padding: 1.5rem; }

    /* Mobile adjustments for the new compact grids */
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }
    .stat-box-compact {
        padding: 0.8rem 0.2rem;
        min-width: 0;
        word-wrap: break-word;
    }
    .stat-box-compact .stat-label {
        font-size: 0.65rem;
        white-space: normal;
    }
}

/* Profile Season Selector */
.profile_season_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.profile_season_select_wrapper {
    position: relative;
    display: inline-block;
}

.profile_season_select {
    appearance: none;
    background-color: #1a233a;
    color: var(--text-main);
    border: 1px solid rgba(42, 86, 255, 0.4);
    padding: 0.4rem 2rem 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile_season_select:focus {
    outline: none;
    border-color: var(--accent-sim);
    box-shadow: 0 0 10px rgba(42, 86, 255, 0.3);
}

.profile_season_select_wrapper::after {
    content: '▼';
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    pointer-events: none;
    color: var(--text-muted);
}