/* Enhanced Menu Styles with Icons and Animations */

/* Theme Variables */
:root {
    /* Default Dark Theme variables that might be missing or need re-definition for independence */
    --header-bg: rgba(15, 23, 42, 0.95);
    --header-border: rgba(255, 255, 255, 0.1);
    --header-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    
    --icon-bg: rgba(255, 255, 255, 0.1);
    --icon-border: rgba(255, 255, 255, 0.1);
    --icon-hover-bg: rgba(0, 255, 255, 0.2);
    --icon-hover-shadow: 0 8px 24px rgba(0, 255, 255, 0.2);
    
    --nav-hover-bg: rgba(0, 255, 255, 0.1);
    
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus-bg: rgba(255, 255, 255, 0.1);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg: #f8fafc;
    --panel: #ffffff;
    --muted: #64748b;
    --text: #0f172a;
    --primary: #3b82f6;
    --primary-600: #2563eb;
    --card: #ffffff;
    --ring: #e2e8f0;
    
    --header-bg: rgba(255, 255, 255, 0.9);
    --header-border: rgba(0, 0, 0, 0.05);
    --header-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    
    --icon-bg: rgba(0, 0, 0, 0.05);
    --icon-border: rgba(0, 0, 0, 0.05);
    --icon-hover-bg: rgba(59, 130, 246, 0.1);
    --icon-hover-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    
    --nav-hover-bg: rgba(59, 130, 246, 0.1);
    
    --input-bg: rgba(0, 0, 0, 0.05);
    --input-border: rgba(0, 0, 0, 0.1);
    --input-focus-bg: rgba(0, 0, 0, 0.08);
}

/* Icon Navigation Styles */
.icon-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--icon-bg);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    color: var(--muted);
    text-decoration: none;
}

.icon-nav-item:hover {
    background: var(--icon-hover-bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--icon-hover-shadow);
}

.icon-nav-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--panel);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid var(--ring);
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.icon-nav-item:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.icon-nav-item i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.icon-nav-item:hover i {
    transform: scale(1.1);
}

/* Enhanced Header Styles */
.site-header.enhanced {
    /* Glass Window Design Variables */
    --glass-opacity: 0.85;
    --glass-blur: 20px;
    --glass-saturation: 180%;
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    --glass-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);

    /* Base Layout */
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: var(--header-height, 70px);
    
    /* Aesthetic & Material (Glass Effect) */
    background: var(--header-bg); /* Fallback */
    background: linear-gradient(
        to bottom,
        rgba(15, 23, 42, 0.9) 0%,
        rgba(15, 23, 42, 0.8) 100%
    );
    
    /* Insulation (Blur & Saturation) */
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    
    /* Structural Integrity (Border & Shadow) */
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    
    /* Transitions */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glass Variants (Customization Options) */
.site-header.glass-frosted {
    --glass-blur: 30px;
    --glass-opacity: 0.6;
    background: rgba(15, 23, 42, 0.6);
}

.site-header.glass-clear {
    --glass-blur: 10px;
    --glass-opacity: 0.9;
    background: rgba(15, 23, 42, 0.9);
}

/* Shine Effect for "High Quality Material" look */
.site-header.enhanced::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.4) 50%, 
        rgba(255,255,255,0) 100%
    );
    opacity: 0.5;
}

.header-wrap.enhanced {
    padding: 0 20px;
    max-width: 1551px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Changed from space-between */
    gap: 20px;
    height: var(--header-height);
}

.icon-nav {
    margin-left: auto; /* Pushes the icon nav to the right */
}

/* Glass Effect Mixin/Class */
.glass-panel {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Enhanced Navigation with Icons */
.nav.enhanced {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

/* Glass Dropdown Menu */
.dropdown-menu {
    background: rgba(15, 23, 42, 0.85) !important; /* Override default panel color */
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    border-radius: 16px !important;
    padding: 8px !important;
    overflow: hidden;
    animation: glassSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes glassSlideUp {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-menu a {
    border-radius: 10px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.nav-link-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: var(--muted);
    font-weight: 600;
    /* Subtle border for glass feel */
    border: 1px solid transparent;
}

.nav-link-with-icon:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-link-with-icon.active {
    color: var(--primary);
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.15);
}

/* Remove old underline effect for a cleaner glass button look */
.nav-link-with-icon::before {
    display: none;
}

/* Modern Hover Glow Effect */
.nav-link-with-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nav-link-with-icon:hover::after {
    opacity: 1;
}

.nav-link-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.nav-link-with-icon:hover .nav-link-icon {
    transform: scale(1.2);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    margin-right: -10px;
    z-index: 1001;
}

.nav-toggle:hover {
    color: var(--primary);
}

/* Mobile Enhanced Menu */
@media (max-width: 768px) {
    .icon-nav {
        margin-left: 16px;
        gap: 12px;
    }
    
    .icon-nav-item {
        width: 40px;
        height: 40px;
    }
    
    .icon-nav-item i {
        font-size: 18px;
    }
    
    .nav.enhanced {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 300px;
        /* Glass Effect for Mobile Menu */
        background: rgba(15, 23, 42, 0.85);
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
        flex-direction: column;
        padding: 80px 24px 24px;
        gap: 16px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.3);
    }
    
    .nav.enhanced.show {
        transform: translateX(0);
    }
    
    .nav-link-with-icon {
        justify-content: flex-start;
        padding: 16px;
        width: 100%;
        border-radius: 12px;
        /* Transparent glass items */
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-link-with-icon:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(-5px);
    }
    
    .icon-nav-item::before {
        display: none;
    }

    .nav-toggle {
        display: block;
    }
}

/* Animation Keyframes */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 255, 0); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: rgba(255, 71, 87, 0.9);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 5px rgba(255, 71, 87, 0.3);
}

/* Theme Switcher Enhanced */
.theme-switcher-enhanced {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: var(--muted);
}

.theme-switcher-enhanced:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    transform: rotate(30deg) scale(1.05);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

/* Search Bar in Header */
.search-bar {
    position: relative;
}

.search-input {
    width: 220px;
    padding: 12px 20px 12px 45px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: var(--font-main, inherit);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    width: 280px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    transition: color 0.3s ease;
}

.search-input:focus + .search-icon {
    color: var(--primary);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .search-input {
        width: 180px;
    }
    
    .search-input:focus {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .search-bar {
        display: none;
    }
    
    .icon-nav {
        margin-left: auto;
    }
}

/* Loading Animation for Icons */
.icon-loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
