/* Extrait de resources/views/front/layouts/nav.blade.php */

/* ===================================
   TOP BAR
   =================================== */
.top-bar {
    background:
        radial-gradient(ellipse at 18% 0%, rgba(255, 255, 255, .08), transparent 48%),
        linear-gradient(115deg, #16233A 0%, #1B2E4A 42%, #142139 74%, #203652 100%);
    color: white;
    padding: 9px 0;
    font-size: 13px;
}
.top-bar-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.25s;
    font-size: 13px;
    letter-spacing: 0.01em;
}
.top-bar-link:hover { color: #fff; }
.top-bar-link i { font-size: 12px; opacity: 0.8; }

.social-links {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
@media (max-width: 768px) { .social-links { justify-content: center; } }

.social-link {
    color: rgba(255,255,255,0.7);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.25s;
    background: rgba(255,255,255,0.08);
    font-size: 13px;
}
.social-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}
.social-link-whatsapp { color: #E8B85C; }
.social-link-whatsapp:hover { background: rgba(74,222,128,0.15); color: #E8B85C; }

/* ===================================
   NAVBAR PRINCIPALE
   =================================== */
#mainNavbar {
    transition: box-shadow 0.3s ease, background 0.3s ease;
    padding: 0.6rem 0;
    border-bottom: 3px solid #d9b765;
}
#mainNavbar.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.97) !important;
    backdrop-filter: blur(12px);
}

/* Logo */
.brand-logo img {
    height: 52px;
    transition: transform 0.3s ease;
}
.brand-logo:hover img { transform: scale(1.04); }

/* ===================================
   NAV-ITEMS — AMÉLIORÉS
   =================================== */
.nav-menu {
    gap: 2px; /* très serré — l'espacement vient du padding interne */
    align-items: center;
}

.nav-menu .nav-item {
    position: relative;
}

/* Le lien lui-même */
.nav-menu .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 0;
    /* Manrope, déjà chargée dans app.blade.php */
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    /* Capitales. Le padding et l'interlettrage sont légèrement resserrés pour
       compenser le corps plus grand : au-delà, le menu s'élargit au point de
       pousser les boutons de droite hors de l'écran sur un portable. */
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #374151;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
    overflow: hidden; /* pour le ripple */
}

/* Couche de fond animée au hover */
.nav-menu .nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0;
    background: rgba(49, 95, 70, 0.07);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.2s ease, transform 0.25s ease;
}
.nav-menu .nav-link:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Barre inférieure (hover uniquement) */
/* Barre inférieure retirée : le tracé animé (nav-outline) tient désormais ce
   rôle, au survol comme sur l'onglet actif. Les deux se superposaient. */

/* Texte */
.nav-menu .nav-link .nav-link-text {
    position: relative;
    z-index: 1;
    transition: color 0.2s ease;
}
.nav-menu .nav-link:hover .nav-link-text,
.nav-menu .nav-link:hover {
    color: var(--ye-action-secondary, #315f46);
}

/* ── ÉTAT ACTIF ──
   Plus de fond ni de bordure : c'est le tracé animé qui marque l'onglet
   courant. Ne reste que la différence de couleur et de graisse. */
.nav-menu .nav-link.active {
    color: var(--ye-action-secondary, #315f46);
    font-weight: 700;
}
/* Désactiver le hover-bg quand déjà actif */
.nav-menu .nav-link.active::before { display: none; }

/* Barre de l'onglet actif retirée elle aussi : c'est le tracé animé qui
   marque désormais l'onglet courant, en position de repos. */

/* ── DROPDOWN TOGGLE ── */
.nav-menu .nav-link.dropdown-toggle::after {
    /* L'icône caret Bootstrap — on la redimensionne */
    margin-left: 5px;
    vertical-align: middle;
    border-top: 5px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.2s;
}
.nav-menu .nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
    opacity: 1;
}

/* ===================================
   DROPDOWN MENU
   =================================== */
#mainNavbar .dropdown-menu-modern {
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 16px 48px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
    border-radius: 0;
    padding: 8px;
    margin-top: 8px;
    min-width: 270px;
    animation: dropdownFadeIn 0.18s ease forwards;
}
@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

#mainNavbar .dropdown-menu-donations {
    max-height: 380px;
    overflow-y: auto;
}
#mainNavbar .dropdown-menu-donations::-webkit-scrollbar { width: 5px; }
#mainNavbar .dropdown-menu-donations::-webkit-scrollbar-track { background: #f5f5f5; border-radius: 0; }
#mainNavbar .dropdown-menu-donations::-webkit-scrollbar-thumb {
    background: linear-gradient(#315f46, #e6bd62);
    border-radius: 0;
}

#mainNavbar .dropdown-item {
    border-radius: 0;
    padding: 9px 12px;
    margin: 2px 0;
    font-size: 14px;
    color: #374151;
    font-weight: 450;
    transition: background 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
#mainNavbar .dropdown-item:hover {
    background: rgba(49,95,70,0.07);
    color: var(--ye-action-secondary, #315f46);
    padding-left: 16px;
}

/* Icône dans le dropdown */
#mainNavbar .dropdown-icon {
    width: 28px;
    height: 28px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(49,95,70,0.1);
    color: var(--ye-action-secondary, #315f46);
    font-size: 12px;
    flex-shrink: 0;
    transition: background 0.2s;
}
#mainNavbar .dropdown-icon-muted {
    background: rgba(107,114,128,0.1);
    color: #6b7280;
}
#mainNavbar .dropdown-icon-danger {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}
#mainNavbar .dropdown-item:hover .dropdown-icon {
    background: rgba(49,95,70,0.18);
}
#mainNavbar .dropdown-item:hover .dropdown-icon-danger {
    background: rgba(220,53,69,0.15);
}

/* Item en vedette */
#mainNavbar .dropdown-item-featured {
    background: rgba(49,95,70,0.07);
    font-weight: 600;
    color: var(--ye-action-secondary, #315f46);
}
#mainNavbar .dropdown-item-featured:hover {
    background: rgba(49,95,70,0.13);
}
#mainNavbar .dropdown-item-danger.dropdown-item-featured {
    background: rgba(220,53,69,0.07);
    color: #dc3545;
}
#mainNavbar .dropdown-item-danger.dropdown-item-featured:hover {
    background: rgba(220,53,69,0.13);
}

#mainNavbar .dropdown-item .badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 0;
    margin-left: auto;
    background: linear-gradient(135deg, #315f46, #e6bd62) !important;
}
#mainNavbar .dropdown-divider {
    margin: 6px 0;
    opacity: 0.15;
}

/* ===================================
   ACTIONS DROITE
   =================================== */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}
.navbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(0,0,0,0.1);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0,0,0,0.04);
    border-radius: 0;
}
.lang-flag {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.2s ease;
    opacity: 0.55;
}
.lang-flag img {
    width: 22px;
    border-radius: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.lang-flag:hover {
    opacity: 1;
    background: rgba(49,95,70,0.1);
    transform: translateY(-1px);
}
.lang-flag.active {
    opacity: 1;
    background: rgba(49,95,70,0.14);
    box-shadow: 0 2px 8px rgba(49,95,70,0.2);
}

/* Boutons Auth */
.btn-navbar {
    padding: 7px 13px !important;
    font-size: 13.5px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.22s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
}
.btn-navbar i { font-size: 15px; }

#mainNavbar .btn-outline-primary {
    border-color: var(--ye-action-secondary, #315f46);
    color: var(--ye-action-secondary, #315f46);
    background: transparent;
}
#mainNavbar .btn-outline-primary:hover {
    background: linear-gradient(135deg, #315f46, #244a36);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(49,95,70,0.28);
}

#mainNavbar .btn-outline-secondary {
    border-color: #d1d5db;
    color: #6b7280;
    background: transparent;
}
#mainNavbar .btn-outline-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
    transform: translateY(-2px);
}

/* ── BOUTON DONATE ── */
.btn-donate-nav {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--ye-action-primary, #c84453), var(--ye-action-primary-hover, #a92f3e));
    color: white;
    border: none;
    padding: 9px 20px;
    font-size: 13.5px;
    border-radius: 9px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: all 0.22s ease;
    box-shadow: 0 4px 14px rgba(200,68,83,0.28);
    animation: heartbeat 2.5s ease-in-out infinite;
}
.btn-donate-nav i { font-size: 14px; }
.btn-donate-nav:hover {
    color: white;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(169,47,62,0.36);
    animation: none;
}
@keyframes heartbeat {
    0%, 100% { box-shadow: 0 4px 14px rgba(200,68,83,0.28); }
    50%       { box-shadow: 0 4px 22px rgba(200,68,83,0.42); }
}


/* ===================================
   TOGGLER
   =================================== */
#mainNavbar .navbar-toggler {
    padding: 7px 10px;
    border-radius: 0;
    transition: background 0.2s;
}
#mainNavbar .navbar-toggler:hover { background: rgba(0,0,0,0.05); }
#mainNavbar .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(49,95,70,0.2); }

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1199px) {
    .nav-menu .nav-link { padding: 8px 12px; font-size: 14px; }
    .navbar-actions { gap: 7px; }
}
@media (max-width: 991px) {
    .nav-menu {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(0,0,0,0.08);
        gap: 3px;
    }
    .nav-menu .nav-link {
        padding: 10px 14px;
        border-radius: 0;
    }
    .nav-menu .nav-link.active::after { display: none; }
    .nav-menu .nav-link::after       { display: none; }

    .navbar-actions {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(0,0,0,0.08);
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .navbar-divider { display: none; }

    #mainNavbar .dropdown-menu-modern {
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        border: 1px solid rgba(0,0,0,0.08);
    }
}

/* La barre complète demande jusqu'à 1 340 px en turc et en français.
   En dessous de 1280 px, le menu en écrans empilés prend le relais
   (même seuil que js/shared/menu-mobile.js et css/shared/menu-mobile.css). */
@media (min-width: 992px) and (max-width: 1279.98px) {
    #mainNavbar .navbar-toggler { display: block; margin-left: auto; }
    #mainNavbar .navbar-collapse { display: none !important; }
}
/* De 1280 à 1365 px : barre complète, resserrée. */
@media (min-width: 1280px) and (max-width: 1365.98px) {
    #mainNavbar .brand-logo { margin-right: 12px !important; }
    #mainNavbar .brand-logo img { width: auto; height: 42px; }
    #mainNavbar .navbar-actions .btn-navbar > span:not(.cart-icon-badge) { display: none !important; }
    #mainNavbar .nav-menu .nav-link { padding-inline: 8px !important; }
    #mainNavbar .navbar-divider { display: none; }
}
/* Un membre connecté a deux boutons : leurs libellés demandent 1 600 px. */
@media (max-width: 1599.98px) {
    #mainNavbar .navbar-actions .nb-libelle-compte { display: none !important; }
}
