/**
 * HEADER STYLES - Optimizat si Modern
 * GD-Theme Header CSS - Versiunea Imbunatatita
 */

/* ======================
   HEADER BASE STYLES
   ====================== */

.site-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Header Sticky */
.site-header.sticky-active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
}

body.header-sticky {
    padding-top: 80px;
}

/* Header Wrapper - Flexbox Layout */
.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

/* ======================
   BRANDING / LOGO
   ====================== */

.site-branding {
    flex-shrink: 0;
    z-index: 1001;
}

.custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.custom-logo {
    max-height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.custom-logo:hover {
    transform: scale(1.05);
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-title a:hover {
    color: #0d6efd;
}

.site-description {
    margin: 0.25rem 0 0 0;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
}

/* ======================
   NAVIGATION
   ====================== */

.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.menu-toggle {
    display: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.menu-toggle:active {
    transform: translateY(0);
}

.menu-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    margin: 3px 0;
}

/* Hamburger Animation */
.menu-toggle.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.menu-toggle.active .menu-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.menu-toggle-text {
    font-weight: 600;
    font-size: 0.875rem;
}

/* Navigation Menu - Desktop */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-menu li {
    margin: 0;
    padding: 0;
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 0.625rem 1rem;
    color: #212529;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current_page_item > a {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #0d6efd;
}

/* Dropdown Menu - Desktop */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-width: 200px;
    list-style: none;
    margin: 0.5rem 0 0 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 0.5rem 0.875rem;
    color: #212529;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.nav-menu .sub-menu li a:hover {
    background: #f8f9fa;
    color: #0d6efd;
    padding-left: 1.125rem;
}

/* ======================
   USER ACCOUNT SECTION
   ====================== */

.user-account-section {
    flex-shrink: 0;
    z-index: 1001;
}

/* User Info - cand este autentificat */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 2rem;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.user-info:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-greeting {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
}

.logout-link {
    font-size: 11px;
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}

.logout-link:hover {
    color: #dc3545;
}

/* Guest Actions - cand nu este autentificat */
.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn svg {
    width: 16px;
    height: 16px;
}

/* ======================
   HEADER LAYOUTS
   ====================== */

/* Layout: Centered */
.site-header.layout-centered .header-wrapper {
    flex-direction: column;
    text-align: center;
}

.site-header.layout-centered .site-branding {
    margin-bottom: 1rem;
}

.site-header.layout-centered .main-navigation {
    width: 100%;
}

/* Layout: Split */
.site-header.layout-split .header-wrapper {
    justify-content: space-between;
}

.site-header.layout-split .main-navigation {
    flex: 0 0 auto;
}

/* ======================
   RESPONSIVE STYLES
   ====================== */

/* Tablet: max-width 991px */
@media (max-width: 991px) {
    .header-wrapper {
        flex-wrap: nowrap;
        gap: 0.75rem;
        padding: 0.75rem 0;
    }
    
    .site-branding {
        flex: 0 1 auto;
        max-width: 50%;
    }
    
    .user-account-section {
        flex: 0 0 auto;
        order: 2;
    }
    
    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        order: 3;
        width: 100%;
        flex: none;
        margin-top: 0;
    }
    
    .menu-toggle {
        display: flex;
        order: 1;
        margin-left: auto;
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .menu-toggle-bar {
        width: 16px;
    }
    
    /* Menu Mobile - Compact si Modern */
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        border-radius: 0 0 0.75rem 0.75rem;
        padding: 0.75rem;
        margin: 0;
        gap: 0;
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-menu > li:last-child {
        border-bottom: none;
    }
    
    .nav-menu > li > a {
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        font-size: 0.9rem;
        margin: 0.125rem 0;
    }
    
    /* Dropdown pe mobile - Compact */
    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        margin: 0.25rem 0 0.5rem 0;
        padding: 0.5rem;
        border-radius: 0.375rem;
        display: none;
    }
    
    .nav-menu li.menu-item-has-children.active > .sub-menu {
        display: block;
        animation: slideDown 0.2s ease;
    }
    
    .nav-menu .sub-menu li {
        border: none;
    }
    
    .nav-menu .sub-menu li a {
        padding: 0.5rem 0.875rem;
        background: transparent;
        font-size: 0.85rem;
        margin: 0.125rem 0;
    }
    
    .nav-menu .sub-menu li a:hover {
        background: #fff;
        padding-left: 1.125rem;
    }
    
    /* User section mai compact pe mobile */
    .user-info {
        padding: 0.375rem 0.75rem;
        gap: 8px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .user-greeting {
        font-size: 12px;
    }
    
    .logout-link {
        font-size: 10px;
    }
    
    .login-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .login-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Mobile: max-width 768px */
@media (max-width: 768px) {
    .site-header {
        padding: 0;
    }
    
    .header-wrapper {
        padding: 0.625rem 0;
        gap: 0.5rem;
    }
    
    .custom-logo {
        max-height: 40px;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .site-description {
        font-size: 0.75rem;
    }
    
    .site-branding {
        max-width: 45%;
    }
    
    .menu-toggle {
        padding: 0.5rem 0.75rem;
    }
    
    .menu-toggle-text {
        font-size: 0.75rem;
    }
    
    .nav-menu {
        padding: 0.625rem;
    }
    
    .nav-menu > li > a {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
    
    body.header-sticky {
        padding-top: 65px;
    }
}

/* Small Mobile: max-width 576px */
@media (max-width: 576px) {
    .header-wrapper {
        gap: 0.375rem;
    }
    
    .site-branding {
        max-width: 40%;
    }
    
    .custom-logo {
        max-height: 36px;
    }
    
    .site-title {
        font-size: 1.125rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .user-info {
        gap: 6px;
        padding: 0.25rem 0.625rem;
    }
    
    .user-greeting {
        font-size: 11px;
    }
    
    .logout-link {
        font-size: 9px;
    }
    
    .login-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
        gap: 4px;
    }
    
    .menu-toggle {
        padding: 0.5rem;
        gap: 0.375rem;
    }
    
    .menu-toggle-bar {
        width: 14px;
    }
    
    .menu-toggle-text {
        font-size: 0.7rem;
    }
    
    .nav-menu {
        padding: 0.5rem;
        border-radius: 0 0 0.5rem 0.5rem;
    }
    
    .nav-menu > li > a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .nav-menu .sub-menu {
        padding: 0.375rem;
    }
    
    .nav-menu .sub-menu li a {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }
}

/* Extra Small: max-width 425px */
@media (max-width: 425px) {
    .header-wrapper {
        padding: 0.5rem 0;
    }
    
    .site-branding {
        max-width: 35%;
    }
    
    .custom-logo {
        max-height: 32px;
    }
    
    .site-title {
        font-size: 1rem;
    }
    
    .site-description {
        display: none;
    }
    
    .user-details {
        display: none;
    }
    
    .user-info {
        padding: 0.375rem;
    }
    
    .login-btn span {
        display: none;
    }
    
    .login-btn {
        padding: 0.5rem;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
    
    .menu-toggle-text {
        display: none;
    }
    
    .menu-toggle {
        padding: 0.5rem;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
}

/* ======================
   SCROLL BAR STYLING
   ====================== */

.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}