/**
 * Header & Navigation Fixes
 * Ensures proper display of the header navigation
 */

/* Header styles and positioning fixes */

:root {
    --header-height: 70px;
}

header {
    background-color: rgba(10, 10, 10, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space between logo and nav */
    box-shadow: 0 2px 20px rgba(0, 240, 255, 0.15);
    height: var(--header-height, 70px); /* Use variable with fallback */
    padding: 0;
    margin: 0;
}

.logo {
    display: flex;
    align-items: center;
    margin-left: 2rem; /* Increased left margin */
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    margin-left: 10px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 2.65rem; /* Increased from 2.25rem to make it bigger */
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

nav {
    display: flex;
    align-items: center;
    margin-right: 1rem; /* Added right margin for spacing */
    height: 100%;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-links li {
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-links a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 20px; /* Increased from 15px for better spacing */
    color: var(--text-primary);
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    position: relative;
    transition: all 0.3s ease;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.actions {
    display: flex;
    align-items: center;
    margin-left: 2rem; /* Increased spacing */
    margin-right: 2rem; /* Increased right margin */
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.signup-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
}

.signup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
}

/* Mobile menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 20px;
}

/* Light theme adjustments */
[data-theme="light"] header {
    background-color: rgba(247, 250, 252, 0.8);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .logo-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .nav-links a {
    color: var(--dark-text);
}

[data-theme="light"] .action-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--dark-text);
}

[data-theme="light"] .login-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Desktop responsive adjustments */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: var(--header-height, 70px);
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: rgba(10, 10, 10, 0.95);
        padding: 20px 0;
        display: none;
        z-index: 999;
    }
    
    [data-theme="light"] .nav-links {
        background-color: rgba(247, 250, 252, 0.95);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 10px 0;
        height: auto;
    }
    
    .nav-links a {
        padding: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .actions {
        margin-left: auto;
    }
    
    .action-btn {
        display: none;
    }
    
    .signup-btn {
        display: block;
    }
}

/* Header active state for pages */
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    width: 100%;
}

/* Theme toggle in header */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(45deg);
}

/* Fixed body padding for proper header-hero alignment */
body {
    padding-top: var(--header-height, 70px); /* Add padding to account for fixed header */
    margin: 0;
    overflow-x: hidden;
}

/* Hero section connects directly to header */
.hero-section {
    margin-top: 0 !important; /* Remove margin */
    padding-top: 0 !important; /* No additional padding needed since body has padding */
    padding-bottom: 0;
}

/* Add floating glow to cube container */
.cube-container::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 20px;
    background: var(--primary-color);
    filter: blur(30px);
    opacity: 0.4;
    border-radius: 50%;
}

/* Key fix: main content area needs to account for fixed header */
main {
    padding-top: 0;
    margin-top: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ensure no extra space between header and main content */
header + main,
header + .hero-section,
header + section:first-of-type {
    margin-top: 0 !important;
}
