/**
 * Custom Navigation System CSS
 * Modern, clean navigation with hamburger icon and beautiful modal
 */

/* Simple hamburger button - nothing fancy */
.custom-hamburger-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: inline-block;
}

.custom-hamburger-icon:hover {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

/* Simple hamburger lines */
.hamburger-line {
    display: block;
    width: 24px;
    height: 4px;
    background: #333;
    margin: 3px 0;
}

/* ============================================
   MODAL STYLES
   ============================================ */

.custom-nav-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.custom-nav-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Modal overlay */
.custom-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Modal container */
.custom-nav-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    margin: 5vh auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.custom-nav-modal.active .custom-nav-container {
    transform: translateY(0) scale(1);
}

/* Modal header */
.custom-nav-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 20px 0 20px;
}

.custom-nav-close {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: absolute;
    top: 20px;
    right: 20px;
}

.custom-nav-close:hover {
    background: rgba(255, 0, 0, 0.1);
    transform: scale(1.05);
}

.custom-nav-close svg {
    width: 20px;
    height: 20px;
    color: #333;
    transition: color 0.2s ease;
}

.custom-nav-close:hover svg {
    color: #ff4444;
}

/* Modal content */
.custom-nav-content {
    padding: 0 32px 32px 32px;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar */
.custom-nav-content::-webkit-scrollbar {
    width: 6px;
}

.custom-nav-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.custom-nav-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.custom-nav-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Logo */
.custom-nav-logo {
    text-align: center;
    margin-bottom: 32px;
}

.custom-nav-logo-img {
    max-height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

/* ============================================
   NAVIGATION MENU STYLES
   ============================================ */

.custom-nav-menu {
    margin-bottom: 32px;
}

.custom-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-nav-item {
    margin-bottom: 8px;
}

/* Navigation links and toggle buttons */
.custom-nav-link,
.custom-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    margin: 0;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    cursor: pointer;
    outline: none;
}

.custom-nav-link:hover,
.custom-nav-toggle:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #F59E0B;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.custom-nav-link:focus,
.custom-nav-toggle:focus {
    outline: 3px solid rgba(245, 158, 11, 0.5);
    outline-offset: 2px;
    border-color: #F59E0B;
}

/* Active/current menu items */
.custom-nav-item.current-menu-item .custom-nav-link,
.custom-nav-item.current-menu-ancestor .custom-nav-toggle {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border-color: rgba(245, 158, 11, 0.4);
    color: #F59E0B;
    font-weight: 600;
}

/* Submenu arrow */
.submenu-arrow {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.custom-nav-toggle[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

/* ============================================
   SUBMENU STYLES
   ============================================ */

.custom-nav-submenu,
.custom-nav-nested-submenu {
    list-style: none;
    margin: 8px 0 0 16px;
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid rgba(245, 158, 11, 0.3);
    border-radius: 0 8px 8px 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.custom-nav-submenu.active,
.custom-nav-nested-submenu.active {
    max-height: 500px;
    opacity: 1;
}

.custom-nav-subitem,
.custom-nav-nested-item {
    margin: 4px 0;
}

.custom-nav-sublink,
.custom-nav-nested-link,
.custom-nav-nested-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    margin: 0 8px;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: pointer;
}

.custom-nav-sublink:hover,
.custom-nav-nested-link:hover,
.custom-nav-nested-toggle:hover {
    background: rgba(245, 158, 11, 0.08);
    color: #F59E0B;
}

.custom-nav-subitem.current-menu-item .custom-nav-sublink {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
    font-weight: 500;
}

/* Nested submenu (third level) */
.custom-nav-nested-submenu {
    margin-left: 20px;
    border-left-color: rgba(245, 158, 11, 0.2);
}

.custom-nav-nested-toggle {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ============================================
   THEME SWITCHER STYLES
   ============================================ */

.custom-nav-theme-switcher {
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.custom-nav-theme-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-nav-theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.custom-nav-theme-btn:focus {
    outline: 3px solid rgba(245, 158, 11, 0.5);
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .custom-nav-container {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
    }
    
    .custom-nav-header {
        padding: 20px 24px 0 24px;
    }
    
    .custom-nav-content {
        padding: 0 24px 24px 24px;
    }
    
    .custom-nav-link,
    .custom-nav-toggle {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .custom-nav-theme-switcher {
        flex-direction: column;
    }
    
    .custom-nav-theme-btn {
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .custom-nav-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .custom-nav-content {
        padding: 0 20px 20px 20px;
        max-height: calc(100vh - 100px);
    }
    
    .custom-nav-header {
        padding: 20px;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .custom-nav-container {
        background: rgba(30, 30, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .custom-nav-title {
        color: #e0e0e0;
    }
    
    .custom-nav-close svg {
        color: #e0e0e0;
    }
    
    .custom-nav-link,
    .custom-nav-toggle,
    .custom-nav-sublink,
    .custom-nav-nested-link,
    .custom-nav-nested-toggle {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e0e0e0;
    }
    
    .custom-nav-link:hover,
    .custom-nav-toggle:hover,
    .custom-nav-sublink:hover,
    .custom-nav-nested-link:hover,
    .custom-nav-nested-toggle:hover {
        background: rgba(0, 123, 255, 0.2);
        color: #66b3ff;
    }
    
    .custom-nav-submenu,
    .custom-nav-nested-submenu {
        background: rgba(255, 255, 255, 0.02);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Prevent body scroll when modal is open */
body.custom-nav-open {
    overflow: hidden;
}

/* Animation delays for staggered entrance */
.custom-nav-item:nth-child(1) { animation-delay: 0.1s; }
.custom-nav-item:nth-child(2) { animation-delay: 0.15s; }
.custom-nav-item:nth-child(3) { animation-delay: 0.2s; }
.custom-nav-item:nth-child(4) { animation-delay: 0.25s; }
.custom-nav-item:nth-child(5) { animation-delay: 0.3s; }
.custom-nav-item:nth-child(6) { animation-delay: 0.35s; }
.custom-nav-item:nth-child(7) { animation-delay: 0.4s; }
.custom-nav-item:nth-child(8) { animation-delay: 0.45s; }

/* Smooth entrance animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-nav-modal.active .custom-nav-item {
    animation: slideInUp 0.3s ease forwards;
}
