/* =========================================
   RESC SIMRACING PORTAL STYLES
   ========================================= */

/* Override global body background for a lighter, bluer Simracing feel */
body {
    background-color: #0B101E !important; /* Deep Navy Blue */
}

#resc_main_content {
    display: flex;
    flex-direction: column;
    padding-bottom: 4rem;
    padding-top: 80px; 
    transition: padding-top 0.3s ease;
}

/* --- Dynamic Live Banner (Fixed) --- */
#live_banner_container {
    position: fixed;
    left: 0;
    width: 100%;
    background-color: #d80000; 
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 0.5rem 2rem;
    height: 45px;
    z-index: 990; 
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body.is-live #resc_main_content {
    padding-top: 125px; 
}

.live_indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 2;
    background-color: #d80000;
    padding-right: 15px;
}

.pulsing_dot {
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    animation: pulse_dot 1.5s infinite;
}

@keyframes pulse_dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.scrolling_text_container {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    margin: 0 20px;
}

.marquee_text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 15s linear infinite;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

.btn_watch_live {
    background-color: #fff;
    color: #d80000;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
    transition: background-color 0.2s ease;
}

.btn_watch_live:hover {
    background-color: #f0f0f0;
}

/* --- Hero Section --- */
#resc_hero {
    position: relative;
    height: 50vh; 
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-pattern-bg-sim {
    position: absolute;
    top: -50%; 
    left: -50%; 
    width: 200%; 
    height: 200%;
    background-image: url('/assets/logos/rkj_id_white.webp');
    background-size: 250px auto; 
    background-repeat: repeat;
    opacity: 0.08;
    transform: rotate(-18deg); 
    animation: scroll_pattern_bg_sim 20s linear infinite;
    z-index: 1;
}

@keyframes scroll_pattern_bg_sim {
    0% { background-position: 0 0; }
    100% { background-position: -250px 0; } 
}

.overlay-hero-sim {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Gradient fond vers le nouveau bleu nuit */
    background: linear-gradient(to bottom, rgba(42, 86, 255, 0.25) 0%, #0B101E 100%);
    z-index: 2;
}

.sim-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    text-align: center;
}

.hero-logo-large {
    max-width: 450px;
    width: 80%;
    height: auto;
    margin: 0 auto 1.5rem auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.portal-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
}

/* --- Quick Navigation Cards --- */
#resc_quick_nav {
    padding: 2rem 4rem;
    background-color: #0B101E; /* Remplacement de --dark-bg */
    margin-top: -80px;
    position: relative;
    z-index: 10;
}

.nav-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.portal-card {
    position: relative;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    display: block;
}

.card-bg {
    transition: transform 0.6s ease;
}

.card-overlay-sim {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Dégradé utilisant les valeurs RGB de #0B101E (11, 16, 30) */
    background: linear-gradient(to top, rgba(11, 16, 30, 0.95) 0%, rgba(42, 86, 255, 0.2) 100%);
    transition: background 0.4s ease;
    z-index: 2;
}

.portal-card:hover .card-bg {
    transform: scale(1.08);
}

.portal-card:hover .card-overlay-sim {
    background: linear-gradient(to top, rgba(11, 16, 30, 0.9) 0%, rgba(42, 86, 255, 0.5) 100%);
}

.card-content {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 2.5rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.card-content h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-main);
}

.card-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.btn-card {
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s ease;
    border-color: var(--accent-sim);
}

.portal-card:hover .btn-card {
    opacity: 1;
    transform: translateY(0);
    background: var(--accent-sim);
    color: #fff;
    border-color: var(--accent-sim);
}

/* --- News Section --- */
#resc_news {
    padding: 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.section_header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-sim);
    padding-left: 1rem;
}

/* =========================================
   ANNONCES / NEWS (Défilement Horizontal Unifié)
   ========================================= */
.news_grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 1.5rem; /* Espace pour la barre de scroll */
    gap: 1.5rem;
    scrollbar-width: thin; /* Pour Firefox */
    scrollbar-color: var(--accent-sim) rgba(255,255,255,0.05);
    cursor: grab;
}

/* Dragging state classes */
.news_grid.is-dragging {
    cursor: grabbing;
    /* Disable snap while dragging for smooth movement */
    scroll-snap-type: none;
    scroll-behavior: auto; 
}

.news_card img {
    -webkit-user-drag: none;
}

/* Custom Scrollbar pour Webkit (Chrome, Edge, Safari) */
.news_grid::-webkit-scrollbar {
    height: 8px;
}
.news_grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.news_grid::-webkit-scrollbar-thumb {
    background-color: var(--accent-sim);
    border-radius: 4px;
}

.news_card {
    background-color: #151C2D;
    border: 1px solid rgba(42, 86, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.2s;
    display: flex;
    flex-direction: column;
    
    /* Propriétés du carrousel */
    min-width: 300px;
    width: 300px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.news_card:hover {
    background-color: #1a233a;
    transform: translateY(-5px);
    border-color: rgba(42, 86, 255, 0.4);
}

.news_img_wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden; 
}

.news_content {
    padding: 1.2rem; 
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news_date {
    font-size: 0.8rem;
    color: var(--accent-sim);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.news_title {
    font-size: 1.1rem; 
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-main);
}

.news_excerpt {
    color: var(--text-muted);
    font-size: 0.85rem; 
    line-height: 1.4;
}

/* --- Modal --- */
.custom_modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal_backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(8px);
}

.modal_content {
    position: relative;
    background-color: #151C2D; /* Remplacement de --surface-bg */
    border: 1px solid rgba(42, 86, 255, 0.2);
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 2001;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.modal_content::-webkit-scrollbar { display: none; }

#btn_close_modal {
    position: absolute;
    top: 1rem; right: 1rem;
    z-index: 2002;
    background-color: rgba(11, 16, 30, 0.8); /* Adapté au bleu nuit */
}

.modal_image_container {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
}

.modal_image_container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal_text_container {
    padding: 2.5rem;
}

#modal_title {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin: 1rem 0;
}

#modal_body {
    color: var(--text-main);
    line-height: 1.7;
    font-size: 1rem;
}

#modal_body p { margin-bottom: 1rem; }
.muted_tag { color: var(--accent-sim); font-size: 0.9rem; font-weight: bold; }

/* =========================================
   BOUTON D'INSCRIPTION (ULTRA VISIBLE)
   ========================================= */
.btn-register-glow {
    background: linear-gradient(45deg, #ff004c, #ff4800);
    color: #fff !important;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 0 15px rgba(255, 0, 76, 0.5);
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    animation: pulse-glow 2s infinite;
    margin-top: 1.5rem;
    margin-bottom: 4rem;
}

.btn-register-glow:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 25px rgba(255, 0, 76, 0.9);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 15px rgba(255, 0, 76, 0.5); }
    50% { box-shadow: 0 0 25px rgba(255, 0, 76, 0.8); }
    100% { box-shadow: 0 0 15px rgba(255, 0, 76, 0.5); }
}

/* =========================================
   ANNONCES / NEWS
   ========================================= */
.news_meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.news_season_tag {
    background: 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;
    letter-spacing: 0.5px;
}

.news_img_wrapper {
    width: 100%;
    aspect-ratio: 16 / 9; /* Force le format 16:9 pour la miniature */
    overflow: hidden;
}

.news_empty_message {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    padding: 3rem 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,0.1);
}

.btn-show-more-news {
    display: block;
    margin: 2rem auto 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-show-more-news:hover {
    background: rgba(42, 86, 255, 0.2);
    border-color: var(--accent-sim);
}

/* Modal : Conservation du format 16:9 */
.modal_image_container {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto; /* Écrase l'ancienne hauteur fixe de 300px */
}

#modal_body {
    line-height: 1.7;
    color: #ddd;
    margin-top: 1rem;
}

#modal_body h2, #modal_body h3, #modal_body h4 {
    color: #fff;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

#modal_body p {
    margin-bottom: 1rem;
}

#modal_body ul, #modal_body ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

#modal_body li {
    margin-bottom: 0.4rem;
}

#modal_body a {
    color: var(--accent-sim, #2a56ff);
    text-decoration: underline;
    transition: opacity 0.2s;
}

#modal_body a:hover {
    opacity: 0.85;
}

#modal_body .btn-news,
#modal_body a.btn-news {
    display: inline-block;
    background: #2a56ff;
    color: #fff !important;
    padding: 0.6rem 1.4rem;
    border-radius: 4px;
    text-decoration: none !important;
    font-weight: bold;
    margin: 0.8rem 0;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
}

#modal_body .btn-news:hover,
#modal_body a.btn-news:hover {
    background: #1c3fd9;
    transform: translateY(-2px);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 899px) {
    #live_banner_container {
        padding: 0.5rem 1rem;
        justify-content: space-between; 
    }
    
    .scrolling_text_container {
        display: none; 
    }

    #resc_hero { height: auto; padding: 4rem 1.5rem; }
    .hero-logo-large { max-width: 320px; }
    
    #resc_quick_nav { padding: 2rem 1.5rem; margin-top: -40px; }
    #resc_news { padding: 2rem 1.5rem; }

    .news_card {
        min-width: 260px; 
        width: 75vw;
    }
    
    .btn-card { opacity: 1; transform: translateY(0); background: var(--accent-sim); color: #fff; border-color: var(--accent-sim); }

    .modal_image_container { height: 200px; }
    .modal_text_container { padding: 1.5rem; }
}