/*==============================================
  MOBILE HAMBURGER MENU FIX
  Proper styling and positioning for mobile hamburger
  Hotel Nehrus - March 2026
  ================================================*/

/*==============================================
  HAMBURGER BUTTON STYLING
  ================================================*/

/* Global navbar brand reset - prevent Bootstrap defaults */
.navbar-brand-luxury {
    margin-bottom: 0 !important;
    margin-right: 0 !important;
}

/* Mobile Toggle Button */
.navbar-toggler-luxury {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    padding: 0.5rem 0.75rem;
    outline: none;
    cursor: pointer;
    margin-left: auto !important;  /* Push to right side */
    margin-right: 0 !important;
    min-width: 50px;
    min-height: 50px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1100;
    flex-shrink: 0;
}

/* Hover effect */
.navbar-toggler-luxury:hover {
    background: rgba(201, 164, 76, 0.1);  /* Gold background on hover */
    transform: scale(1.05);
}

/* Active/open state */
.navbar-toggler-luxury[aria-expanded="true"] {
    background: rgba(201, 164, 76, 0.15);
}

/* Focus state - accessibility */
.navbar-toggler-luxury:focus {
    box-shadow: 0 0 0 3px rgba(14, 26, 43, 0.1);
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/*==============================================
  HAMBURGER ICON LINES
  ================================================*/

/* Individual spans for hamburger lines */
.navbar-toggler-luxury span {
    display: block;
    background-color: var(--primary-navy);
    height: 4px;
    width: 28px;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
    position: relative;
    margin: 0;
}

/* First line (top) */
.navbar-toggler-luxury span:nth-child(1) {
    margin-bottom: 6px;
}

/* Second line (middle) */
.navbar-toggler-luxury span:nth-child(2) {
    opacity: 1;
    margin-bottom: 6px;
}

/* Third line (bottom) */
.navbar-toggler-luxury span:nth-child(3) {
    margin-bottom: 0;
}

/*==============================================
  HAMBURGER ICON ANIMATION (Open/Close)
  ================================================*/

/* When menu is open */
.navbar-toggler-luxury[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.navbar-toggler-luxury[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.navbar-toggler-luxury[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/*==============================================
  MOBILE NAVBAR LAYOUT
  ================================================*/

/* On mobile screens (less than 992px) */
@media (max-width: 991.98px) {
    /* Navbar base - ensure row direction */
    .navbar-luxury {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        width: 100%;
    }
    
    /* Container inside navbar - logo left, hamburger right */
    .navbar-luxury > .container-fluid {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 1rem;
    }
    
    /* Logo on left - keep in place */
    .navbar-luxury > .container-fluid > .navbar-brand-luxury {
        flex: 0 0 auto;
        margin-right: auto;
        margin-bottom: 0;
        order: 1;
    }
    
    /* Hamburger on right */
    .navbar-luxury > .container-fluid > .navbar-toggler-luxury {
        flex: 0 0 auto;
        margin-left: auto !important;
        margin-right: 0 !important;
        order: 2;
    }
    
    /* Hide mobile menu collapse by default */
    .navbar-collapse {
        display: none !important;
        order: 3;
        flex-basis: 100%;
        margin-top: 1rem;
        background: white;
        border-radius: 8px;
        padding: 1.5rem 1rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
        animation: slideDown 0.3s ease-out;
    }
    
    /* Show menu only when .show class is added */
    .navbar-collapse.show {
        display: block !important;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-link-luxury {
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid rgba(201, 164, 76, 0.1);
        font-size: 0.95rem;
    }
    
    .nav-link-luxury:last-child {
        border-bottom: none;
    }
    
    .nav-link-luxury::after {
        display: none;
    }
}

/* Small mobile phones (320px - 480px) */
@media (max-width: 480px) {
    .navbar-toggler-luxury {
        min-width: 45px;
        min-height: 45px;
        padding: 0.375rem 0.5rem;
    }
    
    .navbar-toggler-luxury span {
        height: 2.5px;
        width: 22px;
    }
    
    .navbar-brand-luxury {
        gap: 0.5rem;
    }
    
    .navbar-logo {
        height: 60px !important;
    }
    
    .navbar-brand-text h4 {
        font-size: 1rem;
    }
    
    .navbar-brand-text span {
        font-size: 0.6rem;
    }
    
    /* Ensure collapse hidden on small mobile */
    .navbar-collapse {
        display: none !important;
    }
    
    .navbar-collapse.show {
        display: block !important;
    }
}

/* Medium mobile phones (481px - 768px) */
@media (max-width: 768px) {
    .navbar-toggler-luxury {
        min-width: 48px;
        min-height: 48px;
    }
    
    .navbar-toggler-luxury span {
        height: 3px;
        width: 24px;
    }
}

/*==============================================
  ANIMATION - HAMBURGER OPEN
  ================================================*/

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100vh;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 100vh;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
}

/*==============================================
  ICON CUSTOMIZATION
  ================================================*/

/* Optional: Custom hamburger icon using CSS only (alternative to spans) */
.navbar-toggler-luxury::before {
    content: '';
    position: absolute;
    display: none; /* Disabled by default, use if needed */
}

/*==============================================
  ACCESSIBILITY IMPROVEMENTS
  ================================================*/

/* Ensure button is always keyboard accessible */
.navbar-toggler-luxury:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .navbar-toggler-luxury {
        border: 2px solid var(--primary-navy);
    }
    
    .navbar-toggler-luxury span {
        height: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .navbar-toggler-luxury span {
        transition: none;
    }
    
    .navbar-collapse {
        animation: none;
    }
}

/*==============================================
  DESKTOP FALLBACK (992px and above)
  ================================================*/

@media (min-width: 992px) {
    .navbar-toggler-luxury {
        display: none;  /* Hide hamburger on desktop */
    }
    
    .navbar-collapse {
        display: flex !important;  /* Always show on desktop */
    }
}

/*==============================================
  LANDSCAPE MODE ADJUSTMENTS
  ================================================*/

@media (max-height: 600px) and (orientation: landscape) {
    .navbar-toggler-luxury {
        min-height: 40px;
    }
    
    .navbar-brand-text h4 {
        font-size: 0.9rem;
    }
    
    .navbar-brand-text span {
        font-size: 0.55rem;
    }
    
    .navbar-collapse {
        margin-top: 0.5rem;
        padding: 1rem;
    }
}

/*==============================================
  DARK MODE SUPPORT (if implemented)
  ================================================*/

@media (prefers-color-scheme: dark) {
    .navbar-toggler-luxury {
        background: rgba(201, 164, 76, 0.05);
    }
    
    .navbar-toggler-luxury:hover {
        background: rgba(201, 164, 76, 0.15);
    }
    
    .navbar-collapse {
        background: #1a1a1a;
        color: white;
    }
}

/*==============================================
  RTLS (Right-to-Left Language) Support
  ================================================*/

[dir="rtl"] .navbar-toggler-luxury {
    margin-left: 0;  /* Remove left auto margin */
    margin-right: auto;  /* Add right auto margin */
}

[dir="rtl"] .navbar-toggler-luxury span:nth-child(1) {
    transform-origin: right center;
}

[dir="rtl"] .navbar-toggler-luxury span:nth-child(3) {
    transform-origin: right center;
}
