/* ======================================================
   landing.css - ENS-NDJ - VERSION CORRIGÉE
   ====================================================== */

/* Zone principale */
.landing-zone {
    height: calc(100vh - var(--header-height, 70px) - 90px);
    min-height: 500px;
}

/* Image de fond */
.landing-bg {
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Voile sombre */
.landing-overlay {
    height: 100%;
    width: 100%;
    background: rgba(0, 50, 30, 0.65);
    position: relative;
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* ======================================================
   TOPBAR (countdown + espace étudiant)
   ====================================================== */

.landing-topbar {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.countdown-box {
    background: #01021e;
    padding: 12px 24px;
    border-radius: 10px;
    color: #a40c0c;
    text-align: center;
    box-shadow: 0 6px 20px rgba(147, 202, 222, 0.5);
}

.countdown-fr,
.countdown-ar {
    margin: 4px 0;
    font-size: 1.2rem;
}

.countdown-ar {
    font-family: "Amiri", "Noto Naskh Arabic", serif;
}

.countdown-box span {
    color: #ff3b3b;
    font-weight: bold;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
}

/* ======================================================
   ESPACE ETUDIANT BOX
   ====================================================== */

.espace-etudiant-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #004d26;
    border: 2px solid #dc3545;
    padding: 12px 24px;
    min-height: 44px;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.espace-etudiant-box:hover {
    background: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    color: #fff;
    text-decoration: none;
}

.espace-etudiant-box i.fa-graduation-cap {
    font-size: 1.3rem;
}

.espace-etudiant-arrow {
    font-size: 0.85rem;
    opacity: 0.8;
    transition: transform 0.2s;
}

.espace-etudiant-box:hover .espace-etudiant-arrow {
    transform: translateX(3px);
    opacity: 1;
}

body.dark-mode .espace-etudiant-box {
    background: #0a1628;
    border-color: #ef5350;
    color: #e2e8f0;
}

body.dark-mode .espace-etudiant-box:hover {
    background: #ef5350;
    box-shadow: 0 6px 20px rgba(239, 83, 80, 0.4);
    color: #fff;
}

/* ======================================================
   COLONNES
   ====================================================== */

.landing-columns {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl, 2rem);
    padding: var(--space-xl, 2rem) var(--space-xl, 2rem) var(--space-lg, 1.5rem);
}

.landing-col {
    flex: 1;
    max-width: 500px;
    color: #fff;
}

.col-fr {
    text-align: left;
}

.col-ar {
    text-align: right;
    font-family: "Amiri", "Noto Naskh Arabic", serif;
}

.landing-col h1 {
    font-size: clamp(1.5rem, 2vw + 0.8rem, 2.2rem);
    margin-bottom: 1rem;
    line-height: 1.35;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.landing-desc {
    font-size: clamp(0.95rem, 1.2vw + 0.5rem, 1.15rem);
    line-height: 1.7;
    opacity: 0.95;
}

/* ======================================================
   BOUTON LANGUE
   ====================================================== */

.landing-action {
    text-align: center;
    padding: 1rem 0 2rem;
}

.btn-lang-landing {
    background: #004d26;
    border: 2px solid #dc3545;
    color: #fff;
    padding: 14px 32px;
    min-height: 44px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-lang-landing:hover {
    background: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* ======================================================
   RESPONSIVE
   ====================================================== */

@media (max-width: 991.98px) {
    .landing-zone {
        height: auto;
        min-height: calc(100vh - 120px);
    }

    .landing-overlay {
        padding: 1.5rem;
    }

    .landing-topbar {
        flex-direction: column;
        align-items: center;
    }

    .landing-columns {
        flex-direction: column !important;
        padding: 0 1rem;
        gap: 2rem;
    }

    .landing-col {
        width: 100% !important;
        max-width: 100%;
        text-align: center !important;
    }

    .col-ar {
        text-align: center !important;
    }

    .landing-col h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .espace-etudiant-box {
        justify-content: center;
        padding: 14px 32px;
        font-size: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    .countdown-box {
        padding: 10px 16px;
    }

    .countdown-fr,
    .countdown-ar {
        font-size: 0.85rem;
    }

    .countdown-box span {
        font-size: 1rem;
    }

    .espace-etudiant-box {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .landing-col h1 {
        font-size: 1.3rem;
    }

    .landing-desc {
        font-size: 0.9rem;
    }

    .btn-lang-landing {
        font-size: 1rem;
        padding: 12px 24px;
    }
}


/* ======================================================
   RTL
   ====================================================== */

html[lang="ar"] .landing-columns,
html[dir="rtl"] .landing-columns,
body.rtl .landing-columns,
body.lang-ar .landing-columns {
    flex-direction: row-reverse;
}

@media (max-width: 991.98px) {
    html[lang="ar"] .landing-columns,
    html[dir="rtl"] .landing-columns,
    body.rtl .landing-columns,
    body.lang-ar .landing-columns {
        flex-direction: column !important;
    }
}


/* ======================================================
   BANDEAU DEFILANT DES ACTUALITES
   Cadre = 50% de la largeur ; cartes ~50% des cartes d'origine
   ====================================================== */

.landing-news {
    width: 50%;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(1, 2, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    z-index: 10;
}

.landing-news-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 0 16px;
    background: #004d26;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    border-right: 2px solid #dc3545;
}

.landing-news-label:hover {
    background: #dc3545;
    color: #fff;
    text-decoration: none;
}

.landing-news-label i {
    color: #ffd24a;
}

/* Fenêtre qui masque le débordement du ruban */
.landing-news-viewport {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
}

.landing-news-track {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 8px 0;
    width: max-content;
    animation: landing-news-scroll 40s linear infinite;
}

.landing-news:hover .landing-news-track {
    animation-play-state: paused;
}

/* Carte du ruban : ~50% d'une carte d'actualité standard (≈180×110) */
.news-ticker-card {
    flex: 0 0 auto;
    width: 180px;
    height: 110px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    margin-left: 12px;
}

.news-ticker-card:first-child {
    margin-left: 12px;
}

.news-ticker-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

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

.news-ticker-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    padding: 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 10%, rgba(0, 0, 0, 0.15) 70%, transparent);
}

.news-ticker-cat {
    align-self: flex-start;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: #dc3545;
    padding: 1px 6px;
    border-radius: 4px;
}

.news-ticker-title {
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes landing-news-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Le ruban défile vers la droite en arabe (RTL) */
html[dir="rtl"] .landing-news-track,
body.lang-ar .landing-news-track {
    animation-direction: reverse;
}

@media (prefers-reduced-motion: reduce) {
    .landing-news-track { animation: none; }
    .landing-news-viewport { overflow-x: auto; }
}

@media (max-width: 991.98px) {
    .landing-news { width: 92%; }
    .news-ticker-card { width: 150px; height: 95px; }
}