/* ========================================
   Academy Menu Bar - Modern Stacked Layout
   ======================================== */

/* NAVBAR BASE */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    box-sizing: border-box;
}

/* Add padding to body to account for fixed navbar */
body {
    padding-top: 110px;
}

/* Adjust for different screen sizes */
@media (max-width: 1024px) {
    body {
        padding-top: 105px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 55px;
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}

/* ========================================
   MAIN WRAPPER: Logo Column + Content
   ======================================== */
.nav-main-wrapper {
    display: flex;
    align-items: stretch;
    gap: 2rem;
}

/* LOGO COLUMN (Spans both rows vertically) */
.logo-column {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    padding-right: 2rem;
    min-width: 180px;
}

.logo {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.logo-link:hover {
    opacity: 0.85;
}

.logo-link img {
    max-width: 160px;
    width: 160px;
    height: auto;
    display: block;
    object-fit: contain;
}

.logo-link h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
}

/* CONTENT WRAPPER (Contains both rows) */
.nav-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   FIRST ROW: CTA Items (Smaller)
   ======================================== */
.academy-nav-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 50px;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #e5e7eb;
}

/* CTA SECTION (Right side) */
.nav-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
    flex-shrink: 0;
}

/* Static Menu Items in First Row */
.nav-cta .static-menu-item {
    color: #475569;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-cta .static-menu-item:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

/* Buttons */
.nav-cta .btn.btn-primary {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    white-space: nowrap;
    cursor: pointer;
}

.nav-cta .btn.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
    color: white;
}

/* Cart Icon */
.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
    flex-shrink: 0;
    cursor: pointer;
}

.cart-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 0.15rem 0.35rem;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

/* ========================================
   SECOND ROW: Combined Menu
   ======================================== */
.combined-menu-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 0.5rem 0;
    background: #ffffff;
    box-sizing: border-box;
    min-height: 50px;
}

/* Dynamic Items Container */
.dynamic-items {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Static Items Container */
.static-items {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Dropdown Buttons */
.dynamic-items .dropdown {
    position: relative;
}

.dynamic-items .dropdown .nav-link.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    color: #334155;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.dynamic-items .dropdown .nav-link.dropdown-toggle:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.dynamic-items .dropdown .nav-link.dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.dynamic-items .dropdown:hover .nav-link.dropdown-toggle i {
    transform: rotate(180deg);
}

/* Static Menu Links in Second Row */
.static-menu-item {
    color: #334155;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.static-menu-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.static-menu-item:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.static-menu-item:hover::after {
    width: 70%;
}

/* ========================================
   DROPDOWN MENUS
   ======================================== */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    min-width: 220px;
    width: max-content;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    overflow: visible;
    z-index: 1100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown:first-child .dropdown-menu {
    left: 0;
    transform: translateX(0) translateY(-10px);
}

.dropdown:last-child .dropdown-menu {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(-10px);
}

.dropdown:first-child:hover .dropdown-menu,
.dropdown:last-child:hover .dropdown-menu {
    transform: translateX(0) translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, transparent 100%);
    color: #667eea;
    border-left-color: #667eea;
    padding-left: 1.5rem;
}

/* Custom Scrollbar for Dropdown */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 10px;
}

.dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #764ba2, #667eea);
}

/* ========================================
   MOBILE HEADER & MENU
   ======================================== */
.academy-mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.academy-mobile-logo {
    flex: 0 0 auto;
}

.academy-mobile-logo-link {
    display: flex;
    align-items: center;
}

.academy-mobile-menu-btn {
    display: flex !important;
    cursor: pointer;
    font-size: 1.5rem;
    color: #334155;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    flex-shrink: 0;
}

.academy-mobile-menu-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.academy-mobile-nav {
    display: none;
    width: 100%;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.academy-mobile-nav.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.academy-mobile-nav-content {
    padding: 1rem;
}

.academy-mobile-dropdown {
    margin-bottom: 0.5rem;
}

.academy-mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.academy-mobile-dropdown-toggle:hover {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
    border-color: #667eea;
}

.academy-mobile-dropdown-menu {
    display: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    background: #f9fafb;
    border-radius: 8px;
}

.academy-mobile-dropdown-menu.active {
    display: block;
}

.academy-mobile-dropdown-item {
    display: block;
    padding: 0.7rem 1.2rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.academy-mobile-dropdown-item:hover {
    background: white;
    color: #667eea;
    border-left-color: #667eea;
    padding-left: 1.5rem;
}

.academy-mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.academy-mobile-nav-link:hover {
    background: rgba(102, 126, 234, 0.08);
    color: #667eea;
}

.academy-mobile-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.academy-mobile-btn.academy-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.academy-mobile-btn.academy-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
    color: white;
}

.academy-mobile-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 8px;
    height: 48px;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    position: relative;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 20px;
    }

    .nav-main-wrapper {
        gap: 1.5rem;
    }

    .logo-column {
        min-width: 150px;
        padding-right: 1.5rem;
    }

    .logo-link img {
        max-width: 140px;
        width: 140px;
    }

    .academy-nav-content {
        height: 45px;
    }

    .nav-cta {
        gap: 0.75rem;
    }

    .nav-cta .static-menu-item {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
    }

    .nav-cta .btn.btn-primary {
        padding: 0.5rem 1.2rem;
        font-size: 0.875rem;
    }

    .combined-menu-row {
        gap: 1rem;
        padding: 0.4rem 0;
    }

    .dynamic-items {
        gap: 0.5rem;
    }

    .dynamic-items .dropdown .nav-link.dropdown-toggle {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .static-items {
        gap: 1.5rem;
    }

    .static-menu-item {
        font-size: 0.9rem;
        padding: 0.45rem 0.9rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .desktop-nav,
    .nav-main-wrapper {
        display: none !important;
    }
    
    .academy-mobile-header {
        display: flex !important;
    }

    .academy-mobile-logo-link img {
        max-width: 130px;
        width: 130px;
    }
    
    .academy-mobile-nav {
        max-height: calc(100vh - 60px);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }

    .academy-mobile-header {
        height: 55px;
    }

    .academy-mobile-logo-link img {
        max-width: 110px;
        width: 110px;
    }

    .cart-icon,
    .academy-mobile-cart-icon {
        width: 36px;
        height: 36px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dropdown-menu {
    animation: fadeIn 0.3s ease;
}

/* Active States */
.static-menu-item.active,
.nav-link.active,
.mobile-nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.static-menu-item.active::after {
    width: 70%;
}

/* Scrolled State */
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Focus States for Accessibility */
.nav-link:focus,
.btn:focus,
.cart-icon:focus,
.static-menu-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
