/**
 * Modern Header Styles - Motoristi.EU Rebrand
 * Bold, Professional, Clean Design
 */

/* ==== MODERN HEADER ==== */
.modern-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #272727;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    transition: all 0.15s ease;
}

/* Light mode header */
body[data-theme*="light"] .modern-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: #e5e7eb;
}

/* ==== HEADER SECTIONS ==== */
.header-left {
    display: flex;
    align-items: center;
    min-width: 200px; /* Reserve space for logo */
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px; /* Balance with left side */
    justify-content: flex-end;
}

/* ==== LOGO ==== */
.modern-logo {
    height: 48px;
    width: auto;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.modern-logo:hover {
    opacity: 0.8;
}

/* ==== PRIMARY NAVIGATION ==== */
.modern-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    position: relative;
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.15s ease;
    padding: 8px 0;
    white-space: nowrap;
}

body[data-theme*="light"] .nav-link {
    color: #374151;
}

.nav-link:hover {
    color: #ffffff;
}

body[data-theme*="light"] .nav-link:hover {
    color: #111827;
}

/* Active state - NO special styling, treat same as other links */
.nav-link.active {
    font-weight: normal;
    color: inherit;
}

body[data-theme*="light"] .nav-link.active {
    color: inherit;
}

/* Animated underline - ONLY on hover for ALL links */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color, #dc2626);
    transform: translateX(-50%);
    transition: width 0.15s ease;
}

/* Show underline on hover for ALL nav links */
.nav-link:hover::after {
    width: 100%;
}

/* Active link also only shows underline on hover */
.nav-link.active::after {
    width: 0;
}

.nav-link.active:hover::after {
    width: 100%;
}

/* ==== UTILITY BUTTONS ==== */
.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 20px;
    color: #d1d5db;
}

body[data-theme*="light"] .header-btn {
    color: #374151;
}

.header-btn:hover {
    background: #1e1e1e;
}

body[data-theme*="light"] .header-btn:hover {
    background: #f3f4f6;
}

/* ==== LANGUAGE SWITCHER ==== */
.language-switcher {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.15s ease;
}

body[data-theme*="light"] .language-btn {
    color: #374151;
}

.language-btn:hover {
    background: #1e1e1e;
}

body[data-theme*="light"] .language-btn:hover {
    background: #f3f4f6;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 120px;
    background: #1e1e1e;
    border: 1px solid #404040;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    z-index: 1001;
}

body[data-theme*="light"] .language-dropdown {
    background: #ffffff;
    border-color: #e5e7eb;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
}

body[data-theme*="dark"] .language-option {
    color: #d1d5db;
}

.language-option:hover {
    background: #f3f4f6;
}

body[data-theme*="dark"] .language-option:hover {
    background: #2a2a2a;
}

.language-option.active {
    font-weight: 600;
    color: var(--accent-color, #dc2626);
}

/* ==== LOGIN BUTTON (PRIMARY CTA) ==== */
.login-btn {
    padding: 12px 24px;
    height: 40px;
    background: var(--accent-color, #dc2626);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

.login-btn:hover {
    background: var(--accent-hover, #b91c1c);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

/* ==== SEARCH MODAL ==== */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 2000;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

body[data-theme*="dark"] .search-modal-content {
    background: #1e1e1e;
}

.search-modal.active .search-modal-content {
    transform: scale(1);
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', 'Roboto', sans-serif;
    background: #f9fafb;
    transition: all 0.15s ease;
}

body[data-theme*="dark"] .search-input {
    background: #2a2a2a;
    border-color: #404040;
    color: #ffffff;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color, #dc2626);
    background: #ffffff;
}

body[data-theme*="dark"] .search-input:focus {
    background: #1e1e1e;
}

.search-results {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: #f3f4f6;
}

body[data-theme*="dark"] .search-result-item:hover {
    background: #2a2a2a;
}

/* ==== MOBILE MENU ==== */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #374151;
    transition: all 0.3s ease;
}

body[data-theme*="dark"] .mobile-menu-btn span {
    background: #d1d5db;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 999;
    padding: 24px;
}

body[data-theme*="dark"] .mobile-menu {
    background: #0f0f0f;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-link {
    padding: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
}

body[data-theme*="dark"] .mobile-nav-link {
    color: #d1d5db;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: #f3f4f6;
    color: var(--accent-color, #dc2626);
}

body[data-theme*="dark"] .mobile-nav-link:hover,
body[data-theme*="dark"] .mobile-nav-link.active {
    background: #1e1e1e;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
    .modern-header {
        padding: 0 16px;
    }
    
    .header-center,
    .header-left .modern-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .login-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .language-btn {
        padding: 8px;
    }
    
    .language-btn span:last-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .login-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}
