/* ===== NAVBAR STYLES ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    backdrop-filter: none;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Navbar scroll states */
.navbar.navbar-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.navbar.navbar-visible {
    transform: translateY(0);
    opacity: 1;
}

/* Legacy states for backward compatibility */
.navbar.transparent {
    background: white;
    backdrop-filter: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar.visible {
    background: white;
    backdrop-filter: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ===== LOGO STYLES ===== */
.nav-logo a {
    text-decoration: none;
    color: inherit;
}

.nav-logo h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
    font-family: 'Gotu', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* Logo color - always dark since background is white */
.navbar .nav-logo h2 {
    color: #2c3e50;
    text-shadow: none;
}

.navbar.transparent .nav-logo h2 {
    color: #2c3e50;
    text-shadow: none;
}

.navbar.visible .nav-logo h2 {
    color: #2c3e50;
    text-shadow: none;
}

/* ===== DESKTOP MENU STYLES ===== */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* Desktop menu link colors - always dark since background is white */
.navbar .nav-link {
    color: #333;
    text-shadow: none;
}

.navbar.transparent .nav-link {
    color: #333;
    text-shadow: none;
}

.navbar.visible .nav-link {
    color: #333;
    text-shadow: none;
}

.nav-link:hover {
    color: #2c3e50;
    transform: translateY(-1px);
}

/* Dropdown arrow */
.dropdown-toggle i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

/* ===== DESKTOP DROPDOWN STYLES ===== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 280px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

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

.dropdown-menu li {
    margin: 0;
}

.dropdown-link {
    padding: 1rem 1.5rem;
    color: #333 !important;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    text-shadow: none !important;
}

.dropdown-link:hover {
    background: #f8f9fa;
    color: #2c3e50 !important;
    transform: translateX(5px);
}

.dropdown-link i {
    color: #2c3e50;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.dropdown-link span {
    font-weight: 500;
}

/* ===== LANGUAGE SELECTOR STYLES ===== */
.language-selector {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s ease;
    font-family: inherit;
}

.language-btn:hover {
    background: #f8f9fa;
    border-color: #2c3e50;
    color: #2c3e50;
}

.language-btn .fas.fa-globe {
    font-size: 1rem;
    color: #2c3e50;
}

.language-btn .fas.fa-chevron-down {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.language-selector:hover .language-btn .fas.fa-chevron-down,
.language-selector.active .language-btn .fas.fa-chevron-down {
    transform: rotate(180deg);
}

.current-language {
    font-weight: 600;
    color: #2c3e50;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 160px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0s, 0.3s, 0s; /* Add delay only when closing */
    padding: 0.5rem 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1001;
    margin-top: 0.5rem;
}

.language-selector:hover .language-dropdown,
.language-selector.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s, 0s, 0s; /* Remove delay when opening */
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.language-option:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.language-option.active {
    background: #e3f2fd;
    color: #2c3e50;
    font-weight: 600;
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.language-option span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile language options */
.flag-emoji {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.language-mobile-option {
    display: flex;
    align-items: center;
}

/* Hide language selector on mobile */
@media (max-width: 768px) {
    .language-selector {
        display: none;
    }
}

/* ===== MOBILE MENU BUTTON ===== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Mobile button color - always dark since background is white */
.navbar .hamburger-line {
    background: #333;
    box-shadow: none;
}

.navbar.transparent .hamburger-line {
    background: #333;
    box-shadow: none;
}

.navbar.visible .hamburger-line {
    background: #333;
    box-shadow: none;
}

/* Mobile button active state */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

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

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ===== MOBILE MENU PANEL ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -70%;
    width: 70%;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-menu.active {
    right: 0;
    transform: translateX(0);
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.mobile-menu-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><linearGradient id="a" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" style="stop-color:rgb(255,255,255);stop-opacity:0.1" /><stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0" /></linearGradient></defs><rect width="100" height="20" fill="url(%23a)"/></svg>') repeat-x;
    pointer-events: none;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-family: 'Gotu', sans-serif;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.mobile-menu-close {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ===== MOBILE MENU LIST ===== */
.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 1.5rem 0;
}

.mobile-menu-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.mobile-menu-item:hover {
    background: rgba(44, 62, 80, 0.02);
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2.5rem;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 62, 80, 0.05), transparent);
    transition: left 0.5s ease;
}

.mobile-menu-link:hover::before {
    left: 100%;
}

.mobile-menu-link:hover {
    color: #2c3e50;
    padding-left: 3rem;
    background: rgba(44, 62, 80, 0.03);
    box-shadow: inset 4px 0 0 #2c3e50;
}

.mobile-menu-link:active {
    transform: scale(0.98);
}

.mobile-menu-link i {
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #2c3e50;
}

/* ===== MOBILE SUBMENU ===== */
.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.has-submenu.active .mobile-submenu {
    max-height: 300px;
    border-left-color: #2c3e50;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-submenu.active .submenu-toggle i {
    transform: rotate(45deg);
    color: #2c3e50;
}

.mobile-submenu-link {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 3.5rem;
    color: #555;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.mobile-submenu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, #2c3e50, #34495e);
    transition: width 0.3s ease;
}

.mobile-submenu-link:hover::before {
    width: 4px;
}

.mobile-submenu-link:hover {
    color: #2c3e50;
    padding-left: 4rem;
    background: rgba(44, 62, 80, 0.05);
    transform: translateX(5px);
}

.mobile-submenu-link:active {
    transform: translateX(5px) scale(0.98);
}

.mobile-submenu-link i {
    color: #2c3e50;
    width: 20px;
    text-align: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mobile-submenu-link:hover i {
    transform: scale(1.1);
}

.mobile-submenu-link:last-child {
    border-bottom: none;
}

/* ===== MOBILE MENU OVERLAY ===== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu {
        width: 70%;
        right: -70%;
    }
    
    .mobile-menu.active {
        right: 0;
    }
}

@media (max-width: 600px) {
    .mobile-menu {
        width: 80%;
        right: -80%;
    }
    
    .mobile-menu-header {
        padding: 1.8rem 2rem;
    }
    
    .mobile-menu-link {
        padding: 1.3rem 2rem;
        font-size: 1rem;
    }
    
    .mobile-submenu-link {
        padding: 1rem 2.8rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-logo h2 {
        font-size: 1.3rem;
    }
    
    .mobile-menu {
        width: 85%;
        right: -85%;
    }
    
    .mobile-menu-header {
        padding: 1.5rem 1.5rem;
    }
    
    .mobile-menu-header h3 {
        font-size: 1.2rem;
    }
    
    .mobile-menu-close {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }
    
    .mobile-menu-link {
        padding: 1.2rem 1.5rem;
        font-size: 1rem;
    }
    
    .mobile-submenu-link {
        padding: 1rem 2.2rem;
        font-size: 0.9rem;
        gap: 1rem;
    }
}

@media (max-width: 360px) {
    .mobile-menu {
        width: 90%;
        right: -90%;
    }
    
    .mobile-menu-header {
        padding: 1.2rem 1.2rem;
    }
    
    .mobile-menu-header h3 {
        font-size: 1.1rem;
    }
    
    .mobile-menu-link {
        padding: 1rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .mobile-submenu-link {
        padding: 0.9rem 2rem;
        font-size: 0.85rem;
    }
}

/* Navigation Loading States */
.nav-loading .navbar {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.nav-transitioning {
    cursor: wait;
}

.nav-transitioning * {
    pointer-events: none;
}

/* Improved Navigation Link Styles */
.nav-link, .mobile-menu-link, .mobile-submenu-link {
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover, .mobile-menu-link:hover, .mobile-submenu-link:hover {
    transform: translateY(-1px);
}

/* Loading indicator for navigation links */
.nav-link.loading::after,
.mobile-menu-link.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -20px;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Smooth page transitions */
body {
    transition: opacity 0.2s ease;
}

body.nav-loading {
    opacity: 0.95;
}

body.nav-transitioning {
    opacity: 0.9;
}

/* Enhanced dropdown menu animations */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Mobile menu improvements */
.mobile-menu {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mobile-menu-overlay {
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Enhanced mobile submenu animations */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-submenu.active .mobile-submenu {
    max-height: 300px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Improved focus states for accessibility */
.nav-link:focus,
.mobile-menu-link:focus,
.mobile-submenu-link:focus {
    outline: 2px solid #2c3e50;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .navbar,
    .nav-link,
    .mobile-menu,
    .mobile-menu-overlay,
    .mobile-submenu,
    .dropdown-menu {
        transition: none !important;
        animation: none !important;
    }
    
    .nav-link:hover,
    .mobile-menu-link:hover,
    .mobile-submenu-link:hover {
        transform: none;
    }
} 