/* ===== NAVIGATION STYLES ===== */

/* Top Bar */
.top-bar {
    background-color: #2c3e50;
    color: var(--text-white);
    font-size: var(--font-size-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: calc(var(--z-fixed) + 1);
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
}

.top-bar-social {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.top-bar-social .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-white);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

.top-bar-social .social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.top-bar-social .social-link.facebook:hover {
    background-color: #3b5998;
}

.top-bar-social .social-link.twitter:hover {
    background-color: #1da1f2;
}

.top-bar-social .social-link.youtube:hover {
    background-color: #ff0000;
}

.top-bar-info {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.info-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-xs);
}

.info-item i {
    color: var(--secondary-color);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.info-item span {
    white-space: nowrap;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    z-index: var(--z-fixed);
    transition: background-color var(--transition-normal), backdrop-filter var(--transition-normal);
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--text-dark);
}

.logo-img {
    width: auto;
    height: 50px;
    border-radius: var(--radius-md);
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-link {
    font-weight: var(--font-weight-medium);
    color: var(--text-medium);
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: calc(var(--z-fixed) + 2);
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: all var(--transition-fast);
}

/* Enhanced Responsive Design */

/* Large Tablet (1200px - 1024px) */
@media (max-width: 1200px) {
    .top-bar-container {
        padding: 0 var(--space-6);
    }
    
    .nav-container {
        padding: 0 var(--space-6);
    }
}

/* Tablet (1024px - 768px) */
@media (max-width: 1024px) {
    .top-bar-info {
        gap: var(--space-4);
    }
    
    .info-item:last-child {
        display: none;
    }
    
    .nav-menu {
        gap: var(--space-6);
    }
    
    .nav-link {
        font-size: var(--font-size-sm);
        padding: var(--space-2) 0;
    }
}

/* Mobile Large (768px - 640px) */
@media (max-width: 768px) {
    /* Hide entire top bar on mobile - cleaner approach */
    .top-bar {
        display: none;
    }
    
    /* No additional spacing adjustments needed - JavaScript now handles positioning correctly */
    
    .top-bar-container {
        padding: 0 var(--space-4);
        min-height: 44px; /* Improved touch target */
    }
    
    .top-bar-social {
        gap: var(--space-3);
    }
    
    .top-bar-social .social-link {
        width: 44px; /* Improved touch target */
        height: 44px;
        font-size: var(--font-size-sm);
        border-radius: var(--radius-lg);
    }
    
    .top-bar-info {
        gap: var(--space-4);
    }
    
    .info-item {
        font-size: var(--font-size-xs);
    }
    
    .info-item i {
        font-size: var(--font-size-sm);
    }
    
    .navbar {
        top: 0; /* No top bar on mobile, start from top */
        height: 60px;
    }
    
    .nav-container {
        height: 60px;
        padding: 0 var(--space-4);
    }
    
    .logo-img {
        height: 40px;
    }
    
    .top-bar {
        min-height: 44px;
    }
}

/* Mobile Medium (640px - 480px) */
@media (max-width: 640px) {
    .info-item:nth-child(2) {
        display: none;
    }
    
    .top-bar-social .social-link {
        width: 40px;
        height: 40px;
    }
}

/* Mobile Small (480px and below) */
@media (max-width: 480px) {
    /* No additional spacing adjustments needed - JavaScript now handles positioning correctly */
    
    .top-bar-container {
        padding: 0 var(--space-3);
        min-height: 40px;
    }
    
    .top-bar-info .info-item:first-child {
        font-size: 11px;
    }
    
    .top-bar-social .social-link {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .navbar {
        top: 0; /* No top bar on mobile */
        height: 56px;
    }
    
    .nav-container {
        height: 56px;
        padding: 0 var(--space-3);
    }
    
    .logo-img {
        height: 36px;
    }
    
    .top-bar {
        min-height: 40px;
    }
}

/* Enhanced Mobile Navigation */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 60px; /* Only navbar height - no top bar on mobile */
        left: 0;
        width: 100%;
        height: calc(100vh - 60px); /* Full height minus navbar */
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: var(--space-12) var(--space-4);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: calc(var(--z-fixed) + 1);
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-link {
        font-size: var(--font-size-xl);
        font-weight: var(--font-weight-semibold);
        padding: var(--space-4) var(--space-8);
        margin: var(--space-2) 0;
        border-radius: var(--radius-xl);
        transition: all var(--transition-normal);
        text-align: center;
        min-width: 200px;
        background: transparent;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
        color: var(--text-white);
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }
    
    .nav-link::after {
        display: none;
    }
    
}

/* Mobile Contact Info - Hidden by default on all devices */
.mobile-contact-info {
    display: none;
}

/* Show mobile contact info ONLY on mobile devices */
@media (max-width: 768px) {
    .mobile-contact-info {
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
        margin-top: auto;
        padding: var(--space-6) var(--space-4);
        border-top: 1px solid rgba(42, 83, 120, 0.1);
        width: 100%;
        max-width: 300px;
    }
    
    .mobile-contact-item {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        font-size: var(--font-size-sm);
        color: var(--text-dark);
        text-decoration: none;
        padding: var(--space-2);
        border-radius: var(--radius-md);
        transition: background-color var(--transition-fast);
    }
    
    .mobile-contact-item:hover {
        background-color: rgba(42, 83, 120, 0.05);
    }
    
    .mobile-contact-item i {
        font-size: var(--font-size-base);
        color: var(--primary-color);
        width: 20px;
        text-align: center;
    }
    
    .mobile-social-links {
        display: flex;
        gap: var(--space-3);
        justify-content: center;
        margin-top: var(--space-4);
    }
    
    .mobile-social-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
        color: var(--text-white);
        border-radius: var(--radius-full);
        text-decoration: none;
        font-size: var(--font-size-sm);
        transition: transform var(--transition-fast);
    }
    
    .mobile-social-link:hover {
        transform: translateY(-2px);
    }
    
    .nav-toggle {
        display: flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        padding: var(--space-2);
        border-radius: var(--radius-md);
        transition: background-color var(--transition-fast);
    }
    
    .nav-toggle:hover {
        background-color: rgba(42, 83, 120, 0.1);
    }
    
    .bar {
        width: 24px;
        height: 3px;
        background-color: var(--text-dark);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: var(--radius-sm);
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* Mobile Navigation - Small Screens */
@media (max-width: 480px) {
    .nav-menu {
        top: 56px; /* Only navbar height - no top bar */
        height: calc(100vh - 56px); /* Full height minus navbar */
        padding: var(--space-8) var(--space-3);
    }
    
    .nav-link {
        font-size: var(--font-size-lg);
        min-width: 180px;
        padding: var(--space-3) var(--space-6);
    }
    
    .nav-toggle {
        width: 40px;
        height: 40px;
    }
    
    .bar {
        width: 20px;
        height: 2px;
    }
}
