/**
 * Enhanced Header Styles - TRICOLOR ROMÂNESC 🇷🇴
 * Schema de culori: Albastru (#002B7F), Galben (#FCD116), Roșu (#CE1126)
 * Navigație modernă, responsive, cu logo din tricolor
 */

/* ============================================
   VARIABILE CSS - TRICOLOR ROMÂNESC
   ============================================ */
:root {
    --ro-blue: #002B7F;      /* Albastru România */
    --ro-yellow: #FCD116;    /* Galben România */
    --ro-red: #CE1126;       /* Roșu România */
    --ro-blue-light: rgba(0, 43, 127, 0.1);
    --ro-yellow-light: rgba(252, 209, 22, 0.1);
    --ro-red-light: rgba(206, 17, 38, 0.1);
}

/* ============================================
   HEADER BASE STYLES
   ============================================ */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(to right, var(--ro-blue) 33%, var(--ro-yellow) 33%, var(--ro-yellow) 66%, var(--ro-red) 66%);
    border-image-slice: 1;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.8rem 0;
    position: relative;
}

/* ============================================
   LOGO - Transparent cu tricolor
   ============================================ */
.logo {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1001;
    background: transparent !important;
    padding: 0;
    margin: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent !important;
    text-decoration: none;
    position: relative;
}

/* Efect tricolor pe logo hover */
.logo a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(to right, var(--ro-blue) 33%, var(--ro-yellow) 33%, var(--ro-yellow) 66%, var(--ro-red) 66%);
    transition: width 0.4s ease;
}

.logo a:hover::before {
    width: 100%;
}

.logo img.logo-custom,
.logo img.logo-icon {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
    transition: all 0.3s ease;
    background: transparent !important;
    max-height: 50px;
    width: auto;
}

.logo:hover img {
    filter: drop-shadow(0 4px 12px var(--ro-blue));
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ro-blue) 0%, var(--ro-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   MAIN NAVIGATION - TRICOLOR THEME
   ============================================ */
.main-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    padding-left: 200px;
}

.main-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
    border: 2px solid transparent;
}

.main-nav .nav-link i {
    font-size: 1.3rem;
    transition: all 0.3s ease;
    color: var(--ro-blue);
}

.main-nav .nav-link span {
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

/* Hover Effect - Tricolor gradient */
.main-nav .nav-link:hover {
    background: linear-gradient(135deg, var(--ro-blue-light) 0%, var(--ro-yellow-light) 50%, var(--ro-red-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 43, 127, 0.2);
    border-color: var(--ro-blue);
}

.main-nav .nav-link:hover i {
    transform: scale(1.15);
    color: var(--ro-red);
}

/* Active State - Tricolor */
.main-nav .nav-link.active {
    background: linear-gradient(135deg, var(--ro-blue) 0%, var(--ro-red) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 43, 127, 0.4);
    border-color: var(--ro-yellow);
}

.main-nav .nav-link.active i {
    color: var(--ro-yellow);
}

.main-nav .nav-link.active span {
    color: white;
}

/* Admin Link - Special Style cu tricolor */
.main-nav .nav-link.admin-link {
    background: linear-gradient(135deg, var(--ro-red) 0%, var(--ro-blue) 100%);
    color: white;
    font-weight: 600;
    border-color: var(--ro-yellow);
}

.main-nav .nav-link.admin-link i {
    color: var(--ro-yellow);
}

.main-nav .nav-link.admin-link:hover {
    box-shadow: 0 6px 20px rgba(206, 17, 38, 0.4);
    transform: translateY(-3px);
}

/* ============================================
   MOBILE NAV TOGGLE - Hidden
   ============================================ */
.mobile-nav-toggle {
    display: none;
}

/* ============================================
   HEADER ACTIONS
   ============================================ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    flex-wrap: nowrap; /* Butoanele rămân pe același rând */
}

/* Buton Autentificare (când user NU este logat) - Tricolor */
.header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-actions .btn-primary {
    background: linear-gradient(135deg, var(--ro-blue) 0%, var(--ro-red) 100%);
    color: white;
    border: 2px solid var(--ro-yellow);
    box-shadow: 0 4px 12px rgba(0, 43, 127, 0.3);
}

.header-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 43, 127, 0.5);
}

.header-actions .btn-primary i {
    font-size: 1.1rem;
}

/* PWA Install Button - Compact & Elegant cu Tricolor */
.btn-install-pwa,
button.btn-install-pwa {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0.4rem 0.9rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0, 43, 127, 0.25) !important;
    transition: all 0.3s ease !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    background: linear-gradient(135deg, var(--ro-blue) 0%, var(--ro-red) 100%) !important;
    color: white !important;
    border: 1.5px solid var(--ro-yellow) !important;
    flex-shrink: 0 !important;
    margin-right: 0 !important;
    line-height: 1.2 !important;
}

.btn-install-pwa i,
button.btn-install-pwa i {
    font-size: 0.95rem !important;
}

.btn-install-pwa .install-text,
button.btn-install-pwa .install-text {
    font-size: 0.8rem !important;
    display: inline !important;
}

.btn-install-pwa:hover,
button.btn-install-pwa:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 43, 127, 0.35) !important;
}

.btn-install-pwa.hidden,
button.btn-install-pwa.hidden {
    display: none !important;
}

@media all and (display-mode: standalone) {
    .btn-install-pwa,
    button.btn-install-pwa {
        display: none !important;
    }
}

/* ============================================
   USER MENU - Tricolor theme
   ============================================ */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.2rem;
    background: white;
    border: 2px solid var(--ro-blue);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--ro-blue);
}

.user-menu-btn:hover {
    background: linear-gradient(135deg, var(--ro-blue-light) 0%, var(--ro-red-light) 100%);
    border-color: var(--ro-red);
    box-shadow: 0 4px 12px rgba(0, 43, 127, 0.2);
    transform: translateY(-2px);
}

.user-menu-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ro-yellow);
}

.user-menu-btn i.fa-user-circle {
    font-size: 32px;
    color: var(--ro-blue);
}

.user-menu-btn i.fa-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--ro-red);
}

.user-menu:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* USER DROPDOWN - FIX pentru închidere prea rapidă */
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    padding: 0.8rem;
    z-index: 1100;
    animation: slideDown 0.3s ease;
    border-top: 3px solid transparent;
    border-image: linear-gradient(to right, var(--ro-blue) 33%, var(--ro-yellow) 33%, var(--ro-yellow) 66%, var(--ro-red) 66%);
    border-image-slice: 1;
}

/* FIX: Dropdown rămâne deschis când hover pe el */
.user-menu:hover .user-dropdown,
.user-dropdown:hover {
    display: block !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.user-dropdown a:hover {
    background: linear-gradient(135deg, var(--ro-blue-light) 0%, var(--ro-red-light) 100%);
    color: var(--ro-blue);
    transform: translateX(5px);
}

.user-dropdown a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--ro-blue);
}

.user-dropdown a:hover i {
    color: var(--ro-red);
}

.user-dropdown hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 2px solid var(--ro-yellow);
}

/* Booking Badge - Roșu România */
.booking-badge {
    background: var(--ro-red);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    position: absolute;
    right: 10px;
    min-width: 18px;
    text-align: center;
    border: 1px solid var(--ro-yellow);
}

/* ============================================
   RESPONSIVE - Mobile First
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .main-nav {
        gap: 0.3rem;
        padding-left: 180px;
    }
    
    .main-nav .nav-link {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
    
    .main-nav .nav-link i {
        font-size: 1.1rem;
    }
    
    .logo img.logo-custom,
    .logo img.logo-icon {
        max-height: 45px;
    }
}

/* Mobile - ASCUNDE navigația */
@media (max-width: 768px) {
    .site-header {
        border-bottom-width: 2px;
    }
    
    .main-nav {
        display: none !important;
    }
    
    .header-content {
        padding: 0.6rem 0;
        gap: 1rem;
    }
    
    .logo {
        position: relative;
        transform: none;
    }
    
    .logo img.logo-custom,
    .logo img.logo-icon {
        max-height: 40px;
    }
    
    .header-actions {
        margin-left: auto;
        flex-wrap: nowrap !important; /* CRITICAL: Butoanele rămân pe același rând */
        gap: 0.5rem;
    }
    
    /* Butoanele de autentificare pe mobile */
    .header-actions .btn-primary {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .header-actions .btn-primary i {
        font-size: 1rem;
    }
    
    .user-menu-btn span {
        display: none;
    }
    
    .user-menu-btn {
        padding: 0.5rem 0.8rem;
    }
    
    .btn-install-pwa .install-text {
        display: none;
    }
    
    .btn-install-pwa {
        padding: 0.5rem 0.8rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .logo img.logo-custom,
    .logo img.logo-icon {
        max-height: 35px;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    /* Butoane mai mici pe small mobile */
    .header-actions .btn-primary {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .btn-install-pwa {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .user-menu-btn {
        padding: 0.4rem 0.6rem;
    }
    
    .user-menu-btn img,
    .user-menu-btn i.fa-user-circle {
        width: 28px;
        height: 28px;
        font-size: 28px;
    }
    
    .user-dropdown {
        right: -10px;
        min-width: 200px;
    }
}

/* Very Small Mobile */
@media (max-width: 360px) {
    .logo img.logo-custom,
    .logo img.logo-icon {
        max-height: 30px;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    .header-actions {
        gap: 0.3rem;
    }
    
    /* Butoane foarte mici pe very small mobile */
    .header-actions .btn-primary {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .header-actions .btn-primary i {
        font-size: 0.9rem;
    }
    
    .btn-install-pwa {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* ============================================
   FIX pentru JS - Dropdown persistă
   ============================================ */
.user-menu.active .user-dropdown {
    display: block !important;
}
