/**
 * Navbar Stylesheet
 * File: assets/css/navbar.css
 * Transparent to sticky navbar with smooth transitions
 * Complete styling with mobile responsiveness
 * 
 * Color Scheme:
 * - Transparent State: White text, Light Yellow active links
 * - Solid State (Scrolled): Purple background, White text, Light Yellow active links
 */

/* ============================================
   Navbar Container & General Styles
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(230, 230, 230, 0);
    padding-top: 0;
    padding-left: 30px;
}

/* Sticky state when scrolled - PURPLE background */
.navbar.scrolled {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom-color: rgba(230, 230, 230, 1);
    padding-top: 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    height: 70px;
}

/* ============================================
   Logo (Left Side)
   ============================================ */
.navbar-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.navbar-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.navbar-logo-link:hover {
    opacity: 0.8;
}

.navbar-logo-img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.navbar.scrolled .navbar-logo-img {
    filter: brightness(1) invert(0);
}

/* ============================================
   Navigation Menu (Right Side)
   ============================================ */
.navbar-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
}

.navbar-item {
    position: relative;
}

/* TRANSPARENT STATE - WHITE TEXT */
.navbar-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 0;
    transition: color 0.2s ease;
    display: block;
    position: relative;
}

/* SOLID STATE - WHITE TEXT (stays white) */
.navbar.scrolled .navbar-link {
    color: #ffffff;
}

/* HOVER - Light yellow */
.navbar-link:hover {
    color: #ffd700;
}

/* ACTIVE - Light yellow */
.navbar-link.active {
    color: #ffd700;
}

/* Underline animation for active/hover */
.navbar-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffd700;
    transition: width 0.2s ease;
}

.navbar-link:hover::after,
.navbar-link.active::after {
    width: 100%;
}

/* ============================================
   Book Your Ride Button
   ============================================ */

/* TRANSPARENT STATE - White border, white text */
.navbar-btn {
    background: transparent;
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid #ffffff;
    transition: all 0.2s ease;
    display: inline-block;
    cursor: pointer;
}

/* TRANSPARENT STATE - Button hover */
.navbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffd700;
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* SOLID STATE - White background, purple text */
.navbar.scrolled .navbar-btn {
    background: #ffffff;
    color: #667eea;
    border-color: #ffffff;
}

/* SOLID STATE - Button hover */
.navbar.scrolled .navbar-btn:hover {
    background: #ffd700;
    color: #667eea;
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.navbar-item-button .navbar-btn {
    margin-left: 10px;
}

/* ============================================
   Hamburger Menu (Mobile)
   ============================================ */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
}

/* TRANSPARENT STATE - White hamburger lines */
.hamburger-line {
    width: 24px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

/* SOLID STATE - White hamburger lines (stays white) */
.navbar.scrolled .hamburger-line {
    background: #ffffff;
}

/* Hamburger animation when menu is open */
.navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   Responsive Design - Tablet (1024px)
   ============================================ */
@media (max-width: 1024px) {
    .navbar-menu {
        gap: 20px;
    }
    
    .navbar-link {
        font-size: 14px;
    }
    
    .navbar-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ============================================
   Responsive Design - Mobile (768px and below)
   ============================================ */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        gap: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0;
        margin: 0;
        align-items: stretch;
        justify-content: flex-start;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .navbar.scrolled .navbar-menu {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .navbar-menu.active {
        max-height: 400px;
    }
    
    .navbar-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-item:last-child {
        border-bottom: none;
    }
    
    .navbar-link {
        padding: 16px 20px;
        font-size: 15px;
        display: block;
        width: 100%;
        color: #ffffff;
    }
    
    .navbar-link::after {
        display: none;
    }
    
    .navbar-link:hover,
    .navbar-link.active {
        background: rgba(255, 255, 255, 0.1);
        color: #ffd700;
    }
    
    .navbar-item-button {
        border-bottom: none;
        padding: 12px 20px;
    }
    
    .navbar-item-button .navbar-btn {
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 12px 20px;
        background: transparent;
        color: #ffffff;
        border: 1px solid #ffffff;
    }
    
    .navbar-item-button .navbar-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffd700;
        border-color: #ffd700;
    }
    
    .navbar-container {
        height: auto;
        padding: 12px 20px;
    }
}

/* ============================================
   Responsive Design - Small Mobile (480px)
   ============================================ */
@media (max-width: 480px) {
    .navbar-logo-img {
        height: 32px;
        max-width: 150px;
    }
    
    .navbar-container {
        padding: 10px 16px;
    }
    
    .navbar-menu.active {
        max-height: 350px;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2.5px;
    }
    
    .navbar-link {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .navbar-item-button .navbar-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ============================================
   Color Summary
   ============================================ */
/*
   TRANSPARENT STATE:
   - Background: Fully transparent
   - Text: White (#ffffff)
   - Active Link: Light Yellow (#ffd700)
   - Button: Transparent bg, white border, white text
   - Button Hover: Light yellow text and border
   - Hamburger: White lines
   
   SOLID STATE (when scrolled):
   - Background: Purple (#667eea)
   - Text: White (#ffffff)
   - Active Link: Light Yellow (#ffd700)
   - Button: White bg, purple text
   - Button Hover: Light yellow bg and text
   - Hamburger: White lines
*/

/* Existing navbar styles... */

/* ============================================
   Dropdown Styles
   ============================================ */

/* Dropdown Container */
.navbar-dropdown {
    position: relative;
}

.dropdown-arrow,
.submenu-arrow {
    display: inline-block;
    margin-left: 6px;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

/* First Level Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    margin-top: 8px;
}

.navbar-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Items */
.dropdown-item {
    position: relative;
}

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background: #f7fafc;
    color: #667eea;
}

/* Second Level Submenu */
.submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    margin-left: 8px;
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.has-submenu:hover > .dropdown-link .submenu-arrow {
    transform: rotate(0deg);
}

.submenu-item {
    list-style: none;
}

.submenu-link {
    display: block;
    padding: 10px 20px;
    color: #2d3748;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.submenu-link:hover {
    background: #edf2f7;
    color: #667eea;
    padding-left: 24px;
}

/* Active state for routes */
.navbar-dropdown .navbar-link.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

/* ============================================
   Mobile Dropdown Styles
   ============================================ */

@media (max-width: 768px) {
    /* Reset dropdown positioning for mobile */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f7fafc;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin-top: 0;
        padding: 0;
    }

    .navbar-dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 8px 0;
    }

    .navbar-dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Mobile submenu */
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #edf2f7;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin: 0;
        padding: 0;
    }

    .has-submenu.active .submenu {
        max-height: 300px;
        padding: 8px 0;
    }

    .has-submenu.active > .dropdown-link .submenu-arrow {
        transform: rotate(90deg);
    }

    /* Mobile dropdown links */
    .dropdown-link,
    .submenu-link {
        padding-left: 30px;
        font-size: 14px;
    }

    .submenu-link {
        padding-left: 50px;
    }

    .submenu-link:hover {
        padding-left: 54px;
    }

    /* Make arrows clickable on mobile */
    .dropdown-arrow,
    .submenu-arrow {
        pointer-events: none;
    }
}

/* ============================================
   Dropdown Divider
   ============================================ */
.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
    list-style: none;
}

/* ============================================
   View All Links Styling
   ============================================ */
.submenu-view-all {
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    padding-top: 8px;
}

.submenu-link.view-all {
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
}

.submenu-link.view-all:hover {
    color: #764ba2;
    background: rgba(102, 126, 234, 0.05);
}

/* ============================================
   All Routes Link Styling
   ============================================ */
.all-routes-link {
    display: flex;
    align-items: center;
    color: #667eea !important;
    font-weight: 600;
}

.all-routes-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #764ba2 !important;
}

.all-routes-link svg {
    flex-shrink: 0;
}

/* ============================================
   Enhanced Submenu Arrow for Clickable Categories
   ============================================ */
.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.submenu-arrow {
    margin-left: auto;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.has-submenu:hover .submenu-arrow {
    opacity: 1;
}

/* Make category name clickable visual feedback */
.dropdown-item.has-submenu > .dropdown-link {
    position: relative;
}

.dropdown-item.has-submenu > .dropdown-link:hover {
    background: #f3f4f6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .submenu-view-all {
        padding-top: 12px;
        margin-top: 12px;
    }
    
    .all-routes-link {
        padding: 14px 20px;
    }
}
