/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

/* Navigation Base Styles */
.spacegrid-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Cosmic Background Effects */
.cosmic-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.3;
}

.nebula-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 255, 255, 0.05) 0%, transparent 50%, rgba(0, 128, 255, 0.05) 100%);
}

.star-field {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.star:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.star:nth-child(2) { top: 40%; left: 30%; animation-delay: 0.5s; }
.star:nth-child(3) { top: 60%; left: 60%; animation-delay: 1s; }
.star:nth-child(4) { top: 30%; left: 80%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 70%; left: 20%; animation-delay: 2s; }
.star:nth-child(6) { top: 50%; left: 90%; animation-delay: 2.5s; }
.star:nth-child(7) { top: 80%; left: 40%; animation-delay: 3s; }
.star:nth-child(8) { top: 10%; left: 70%; animation-delay: 3.5s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.energy-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.plasma-waves {
    position: absolute;
    width: 100%;
    height: 100%;
}

.wave {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    animation: wave-flow 8s linear infinite;
}

.wave:nth-child(1) { top: 20%; animation-delay: 0s; }
.wave:nth-child(2) { top: 50%; animation-delay: 2s; }
.wave:nth-child(3) { top: 80%; animation-delay: 4s; }

@keyframes wave-flow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Navigation Core */
.nav-core {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    z-index: 10;
}

/* Quantum Logo */
.quantum-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s ease;
}

.quantum-logo:hover {
    transform: scale(1.05);
}

.logo-matrix {
    position: relative;
    width: 50px;
    height: 50px;
}

.matrix-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ffff;
    font-size: 1.2rem;
    z-index: 3;
}

.energy-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ring-pulse 3s ease-in-out infinite;
}

.ring-1 {
    width: 35px;
    height: 35px;
    animation-delay: 0s;
}

.ring-2 {
    width: 45px;
    height: 45px;
    animation-delay: 0.5s;
}

.ring-3 {
    width: 55px;
    height: 55px;
    animation-delay: 1s;
}

@keyframes ring-pulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.quantum-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #00ffff;
    border-radius: 50%;
    animation: particle-float 4s ease-in-out infinite;
}

.particle:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 20%; right: 10%; animation-delay: 1s; }
.particle:nth-child(3) { bottom: 10%; left: 20%; animation-delay: 2s; }
.particle:nth-child(4) { bottom: 20%; right: 20%; animation-delay: 3s; }

@keyframes particle-float {
    0%, 100% { opacity: 0.5; transform: translateY(0px); }
    50% { opacity: 1; transform: translateY(-5px); }
}

.logo-identity {
    font-family: 'Orbitron', monospace;
}

.brand-primary {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.brand-secondary {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ffff;
    line-height: 1;
}

.brand-subtitle {
    font-size: 0.6rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    margin-top: 2px;
}

/* Holographic Menu */
.holo-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.holo-item {
    position: relative;
}

.holo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.holo-link:hover,
.holo-link.active {
    color: #00ffff;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    transform: translateY(-1px);
}

.link-icon {
    font-size: 0.9rem;
}

.holo-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.holo-link:hover .holo-effect {
    left: 100%;
}

.energy-trail {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #00ffff;
    transition: width 0.3s ease;
}

.holo-link:hover .energy-trail,
.holo-link.active .energy-trail {
    width: 100%;
}

/* Mobile Auth Links */
.mobile-auth {
    display: none;
}

/* Quantum Controls */
.quantum-controls {
    display: flex;
    gap: 12px;
}

.quantum-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-btn:hover {
    border-color: #00ffff;
    color: #00ffff;
    transform: translateY(-1px);
}

.register-btn {
    background: #00ffff;
    color: #000000;
    border: 1px solid #00ffff;
}

.register-btn:hover {
    background: #00e6e6;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.btn-core {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

.btn-energy {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.quantum-btn:hover .btn-energy {
    left: 100%;
}

.btn-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.quantum-btn:hover .btn-pulse {
    width: 100%;
    height: 100%;
}

/* Neural Toggle (Mobile Menu) */
.neural-toggle {
    display: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    position: relative;
}

.toggle-matrix {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.matrix-line {
    width: 24px;
    height: 2px;
    background: #00ffff;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.neural-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* Quantum Loading Bar */
.quantum-loader {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loader-track {
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 255, 0.1);
}

.loader-energy {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #0080ff, #00ffff);
    background-size: 200% 100%;
    animation: loader-flow 2s ease-in-out;
}

@keyframes loader-flow {
    0% { width: 0; background-position: 0% 50%; }
    50% { width: 50%; background-position: 100% 50%; }
    100% { width: 100%; background-position: 0% 50%; }
}

.loader-particles {
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 6px;
}

.loader-particles .particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #00ffff;
    border-radius: 50%;
    animation: particle-move 2s ease-in-out;
}

@keyframes particle-move {
    0% { left: 0; opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.loader-particles .particle:nth-child(1) { animation-delay: 0s; }
.loader-particles .particle:nth-child(2) { animation-delay: 0.3s; }
.loader-particles .particle:nth-child(3) { animation-delay: 0.6s; }

/* Holographic Overlay */
.holo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 255, 255, 0.02) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.spacegrid-navbar:hover .holo-overlay {
    opacity: 1;
}

/* Scrolled State */
.spacegrid-navbar.scrolled {
    background: rgba(10, 10, 10, 0.98);
    border-bottom-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Loading State */
.spacegrid-navbar.loading .quantum-loader {
    opacity: 1;
}

/* Mobile Menu Toggle Active State */
.neural-toggle.active .matrix-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.neural-toggle.active .matrix-line:nth-child(2) {
    opacity: 0;
}

.neural-toggle.active .matrix-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-core {
        padding: 0 20px;
    }
    
    .holo-menu {
        gap: 4px;
    }
    
    .holo-link {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .quantum-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .spacegrid-navbar {
        height: 70px;
    }
    
    .nav-core {
        padding: 0 16px;
    }
    
    .holo-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 40px 20px;
        gap: 20px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        border-right: 1px solid rgba(0, 255, 255, 0.1);
    }
    
    .holo-menu.active {
        transform: translateX(0);
    }
    
    .holo-item {
        width: 100%;
        max-width: 300px;
    }
    
    .holo-link {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
        font-size: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.02);
    }
    
    .mobile-auth {
        display: block;
    }
    
    .desktop-controls {
        display: none;
    }
    
    .neural-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .logo-identity .brand-primary,
    .logo-identity .brand-secondary {
        font-size: 1rem;
    }
    
    .brand-subtitle {
        font-size: 0.5rem;
    }
    
    .matrix-core {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .spacegrid-navbar {
        height: 60px;
    }
    
    .nav-core {
        padding: 0 12px;
    }
    
    .holo-menu {
        top: 60px;
        height: calc(100vh - 60px);
        padding: 30px 16px;
    }
    
    .logo-matrix {
        width: 40px;
        height: 40px;
    }
    
    .matrix-core {
        width: 24px;
        height: 24px;
        font-size: 0.9rem;
    }
    
    .ring-1 { width: 28px; height: 28px; }
    .ring-2 { width: 36px; height: 36px; }
    .ring-3 { width: 44px; height: 44px; }
    
    .logo-identity .brand-primary,
    .logo-identity .brand-secondary {
        font-size: 0.9rem;
    }
    
    .brand-subtitle {
        font-size: 0.45rem;
        letter-spacing: 1px;
    }
    
    .neural-toggle {
        width: 35px;
        height: 35px;
    }
    
    .matrix-line {
        width: 20px;
    }
    
    .neural-pulse {
        width: 25px;
        height: 25px;
    }
}

/* Custom Scrollbar for Mobile Menu */
.holo-menu::-webkit-scrollbar {
    width: 4px;
}

.holo-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.holo-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 2px;
}

.holo-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

/* Animation Delays for Menu Items */
.holo-menu.active .holo-item:nth-child(1) { animation: slideInLeft 0.3s ease 0.1s both; }
.holo-menu.active .holo-item:nth-child(2) { animation: slideInLeft 0.3s ease 0.2s both; }
.holo-menu.active .holo-item:nth-child(3) { animation: slideInLeft 0.3s ease 0.3s both; }
.holo-menu.active .holo-item:nth-child(4) { animation: slideInLeft 0.3s ease 0.4s both; }
.holo-menu.active .holo-item:nth-child(5) { animation: slideInLeft 0.3s ease 0.5s both; }
.holo-menu.active .holo-item:nth-child(6) { animation: slideInLeft 0.3s ease 0.6s both; }
.holo-menu.active .holo-item:nth-child(7) { animation: slideInLeft 0.3s ease 0.7s both; }
.holo-menu.active .holo-item:nth-child(8) { animation: slideInLeft 0.3s ease 0.8s both; }

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus States for Accessibility */
.holo-link:focus,
.quantum-btn:focus,
.neural-toggle:focus {
    outline: 2px solid rgba(0, 255, 255, 0.5);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .spacegrid-navbar {
        background: rgba(0, 0, 0, 1);
        border-bottom-color: #00ffff;
    }
    
    .holo-link,
    .quantum-btn {
        border-color: #00ffff;
    }
    
    .cosmic-bg {
        opacity: 0.1;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .star,
    .energy-ring,
    .particle,
    .wave,
    .neural-pulse {
        animation: none;
    }
    
    .holo-effect,
    .btn-energy {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .spacegrid-navbar {
        display: none;
    }
}
