/* ===================================
   AysimaPOS Landing Page - Header Styles
   Modern SaaS Design - Variables Based
   Bootstrap Grid Compliant
   =================================== */

.landing-header {
    position: sticky;
    top: 0;
    z-index: var(--z-index-sticky);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    /* CRITICAL: Smooth transition without layout shift */
    transition: box-shadow var(--transition-duration-300) var(--transition-timing-function-out);
    /* Performance: Isolate reflow with CSS containment */
    contain: layout;
    /* CRITICAL FIX: Fixed height prevents layout shift (CLS) */
    min-height: 64px;
    /* IMPORTANT: Full width for proper Bootstrap grid */
    width: 100%;
    /* IMPORTANT: display: block respects Bootstrap .container grid */
    display: block;
}

.landing-header.scrolled {
    box-shadow: var(--shadow-md);
}

.landing-header .navbar {
    /* IMPORTANT: Bootstrap navbar has its own flexbox (don't override) */
    /* Vertical centering with calculated padding */
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    /* CRITICAL: Fixed total height (padding + content) */
    min-height: 64px;
}

/* Logo Container - Fixed height, smooth scale */
.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: var(--font-weight-extrabold);
    font-size: var(--font-size-xl);
    color: var(--gray-800);
    /* CRITICAL: transform for GPU acceleration (no reflow) */
    transition: transform var(--transition-duration-200) var(--transition-timing-function-out);
    /* Performance: Use will-change for smoother animation */
    will-change: transform;
}

.navbar-brand:hover {
    color: var(--primary-600);
}

/* Logo Icon - Fixed size, scale transform */
.logo-icon {
    /* FIXED SIZE: Prevents reflow */
    height: 40px;
    width: 40px;
    /* CRITICAL: GPU-accelerated scale (no layout shift) */
    transition: transform var(--transition-duration-200) var(--transition-timing-function-out);
    will-change: transform;
}

.landing-header.scrolled .logo-icon {
    /* REMOVED height change (causes reflow) */
    /* ADDED: Scale transform (GPU accelerated, zero layout shift) */
    transform: scale(0.875); /* 35px / 40px = 0.875 */
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-800);
}

.logo-text .text-primary {
    color: var(--primary-600) !important;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation Links */
.navbar-nav .nav-link {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    color: var(--gray-700);
    padding: var(--spacing-2) var(--spacing-4);
    margin: 0 var(--spacing-1);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-duration-200) var(--transition-timing-function-out);
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-600);
    background-color: var(--gray-100);
}

.navbar-nav .nav-link.active {
    color: var(--primary-600);
    font-weight: var(--font-weight-semibold);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* Auth Buttons */
.navbar-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.navbar-buttons .btn {
    padding: var(--spacing-2) var(--spacing-5);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* Mobile Toggle */
.navbar-toggler {
    border: none;
    padding: var(--spacing-2);
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    width: 25px;
    height: 2px;
    background-color: var(--gray-800);
    display: block;
    position: relative;
    transition: all var(--transition-duration-200) var(--transition-timing-function-out);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    width: 25px;
    height: 2px;
    background-color: var(--gray-800);
    position: absolute;
    left: 0;
    transition: all var(--transition-duration-200) var(--transition-timing-function-out);
}

.navbar-toggler-icon::before {
    top: -8px;
}

.navbar-toggler-icon::after {
    top: 8px;
}

/* Mobile Menu */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: var(--spacing-6) 0;
        margin-top: var(--spacing-4);
        border-top: 1px solid var(--gray-300);
        /* Enhanced: Smooth slide-in animation */
        animation: slideInDown 0.3s ease-out;
    }
    
    .navbar-nav {
        margin-bottom: var(--spacing-4);
    }
    
    .navbar-nav .nav-link {
        padding: var(--spacing-4) var(--spacing-4); /* Increased from spacing-3 for 48px touch target */
        margin: var(--spacing-1) 0;
        /* Enhanced: Touch-friendly hover effect */
        font-size: 1.05rem;
    }
    
    .navbar-nav .nav-link:active {
        transform: scale(0.98);
        transition: transform 0.1s ease-out;
    }
    
    .navbar-buttons {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-3);
    }
    
    .navbar-buttons .btn {
        width: 100%;
        justify-content: center;
        /* Enhanced: Larger touch targets */
        min-height: 48px;
        font-size: 1.05rem;
        padding: var(--spacing-4) var(--spacing-6);
    }
    
    /* Enhanced: Animated hamburger to X */
    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
        background-color: transparent;
    }
    
    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
        transform: rotate(45deg);
        top: 0;
    }
    
    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
        transform: rotate(-45deg);
        top: 0;
    }
}

/* Tablet & Desktop */
@media (min-width: 992px) {
    .navbar-nav {
        flex-direction: row;
    }
}

/* Sticky Animation */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Menu Slide-In Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-header.scrolled {
    animation: slideDown 0.3s ease-out;
}
