/**
 * Fixed Header and Vertical Theme Toggle Styles
 */

/* Fixed Navigation Header */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

[data-theme="dark"] .fixed-header {
    background: rgba(15, 23, 42, 0.95);
}

.fixed-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.fixed-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.fixed-header .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.fixed-header .nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fixed-header .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    padding: 0.5rem 0;
}

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

.fixed-header .nav-links .btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fixed-header .nav-links .btn:hover {
    background: var(--primary-dark);
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-nav-toggle .hamburger {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    display: block;
    transition: background 0.2s ease;
}
.mobile-nav-toggle .hamburger::before,
.mobile-nav-toggle .hamburger::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: var(--text-primary); transition: transform .2s ease, opacity .2s ease; 
}
.mobile-nav-toggle .hamburger::before { transform: translateY(-7px); }
.mobile-nav-toggle .hamburger::after  { transform: translateY(7px); }
.mobile-nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.mobile-nav-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg); }
.mobile-nav-toggle[aria-expanded="true"] .hamburger::after  { transform: rotate(-45deg); }

/* Removed obsolete vertical toggle styles */

/* User Profile Section */
.fixed-header .profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.profile-trigger:hover {
    background: var(--bg-secondary);
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 150px;
    z-index: 1000;
}

.profile-dropdown.open { 
    display: block; 
}

.profile-dropdown button,
.profile-dropdown a {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
}

.profile-dropdown button:hover,
.profile-dropdown a:hover {
    background: var(--bg-tertiary);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
    
    .fixed-header .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .fixed-header .nav-links.active {
        display: flex;
    }
    
    .fixed-header .nav-links a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .fixed-header .nav-links a:last-child {
        border-bottom: none;
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.8);
        opacity: 1;
    }
}

/* (Removed obsolete .theme-toggle hide rule) */

/* Body padding to account for fixed header */
body.has-fixed-header {
    padding-top: 60px;
}

/* Prevent header flicker before auth state resolves */
body.auth-pending .fixed-header .nav-links {
    visibility: hidden;
}
body.auth-ready .fixed-header .nav-links {
    visibility: visible;
}

/* XP Pill Styling */
.xp-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.xp-icon {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Particle Hero Section */
.particle-hero {
    position: relative;
    min-height: 500px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.particle-hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem; /* reduced to move right column a bit left */
    max-width: 1200px;
    width: 100%;
    padding: 0 2rem;
    align-items: center;
}

/* Push the image+quote column to the right side on wide screens */
.particle-hero-content > div:last-child {
    justify-self: end;
    width: 100%;
    max-width: 560px; /* keep a pleasant reading width */
}

#particle-portrait {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 0; /* remove card-like rounded corners */
    box-shadow: none; /* remove card shadow */
    background: transparent; /* ensure no white box */
    filter: none !important; /* ensure no color/grayscale filters apply */
}

#physicist-quote {
    text-align: center;
    padding: 1rem 0 0;
}

#physicist-quote blockquote {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-primary);
    margin: 0.25rem 0 0;
    position: relative;
    padding: 0 2rem;
    /* Remove global blockquote box styles */
    background: transparent !important;
    border: 0 !important;
    border-left: 0 !important;
}

#physicist-quote blockquote::before,
#physicist-quote blockquote::after {
    content: '"';
    font-size: 3rem;
    position: absolute;
    opacity: 0.2;
    font-family: serif;
}

#physicist-quote blockquote::before {
    top: -1rem;
    left: 0;
}

#physicist-quote blockquote::after {
    bottom: -2rem;
    right: 0;
    transform: rotate(180deg);
}

#physicist-quote cite {
    display: block;
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: normal;
    font-weight: 500;
}

/* Animated background particles */
.particle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

/* Removed rotating background - particles will be handled by JS */

/* Mobile Responsive */
@media (max-width: 768px) {
    .fixed-header .header-content {
        padding: 0.5rem 1rem;
    }
    
    .fixed-header .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    .fixed-header .nav-links.active {
        display: flex;
    }
    
    .fixed-header .nav-links a,
    .fixed-header .nav-links .profile,
    .fixed-header .nav-links .sign-in-btn {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .fixed-header .nav-links a:last-child,
    .fixed-header .nav-links .sign-in-btn {
        border-bottom: none;
    }

    .fixed-header .xp-pill {
        margin-left: auto;
        margin-right: 1rem;
    }

    .profile-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .profile-dropdown a {
        padding-left: 2rem;
    }

    .fixed-header .mobile-nav-toggle { display: block; }

    /* (Removed obsolete mobile vertical theme toggle overrides) */
    
    .particle-hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    /* Center the image+quote column on small screens */
    .particle-hero-content > div:last-child {
        justify-self: center;
        max-width: 100%;
    }
    
    #particle-portrait {
        height: 300px;
    }
    
    #physicist-quote blockquote {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .user-section {
        right: 55px !important;
        top: 10px !important;
    }
    
    .user-section .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
}
