/* Layout and Navigation styles - Y2K / Frutiger Aero Aesthetic */
/* Inspired by Windows Vista/7 Aero glass with modern theme support */
/* Aurora blobs, glossy highlights, organic glass morphism */

/* ============================================
   NAVBAR - Frutiger Aero Glass Design
   Features: Aurora blobs, glass layers, glossy shine
   ============================================ */

/* Navbar custom properties */
.navbar {
    --nav-height: 68px;

    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    overflow: hidden;

    /* Multi-layer glass background */
    /* NOTE: backdrop-filter removed for battery/CPU optimization - was causing device heating */
    background:
        /* Top glossy highlight - light source simulation */
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.08) 30%,
            transparent 50%
        ),
        /* Main glass tint with theme color */
        linear-gradient(
            180deg,
            rgba(var(--primary-rgb), 0.15) 0%,
            rgba(var(--primary-rgb), 0.08) 50%,
            rgba(var(--primary-rgb), 0.12) 100%
        ),
        /* Solid dark base - increased opacity to compensate for removed blur */
        rgba(15, 23, 42, 0.96);

    /* backdrop-filter REMOVED - causes sustained GPU load and device heating
       The visual effect is maintained through increased background opacity */

    /* Aero-style border with inner glow */
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);

    /* Layered shadows for depth + outer glow */
    box-shadow:
        /* Outer color glow */
        0 4px 40px rgba(var(--primary-rgb), 0.25),
        0 8px 60px rgba(var(--primary-rgb), 0.15),
        /* Inner top highlight (glossy edge) */
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        /* Inner bottom shadow (3D depth) */
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* ============================================
   AURORA BLOBS - Animated color orbs
   Classic Frutiger Aero floating elements
   ============================================ */

.nav-aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Aurora blobs disabled - clean navbar design */
.nav-aurora::before,
.nav-aurora::after {
    display: none;
}

@keyframes auroraFloat1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(30px, 10px) scale(1.1);
        opacity: 1;
    }
}

@keyframes auroraFloat2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-20px, 5px) scale(1.05);
        opacity: 0.9;
    }
}

/* ============================================
   SCAN LINE - Animated light sweep
   ============================================ */

.nav-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 10%,
        rgba(var(--primary-rgb), 0.8) 30%,
        rgba(var(--primary-rgb), 1) 50%,
        rgba(var(--primary-rgb), 0.8) 70%,
        rgba(255, 255, 255, 0.3) 90%,
        transparent 100%
    );
    animation: scanLine 6s ease-in-out infinite;
    opacity: 0.9;
    z-index: 2;
}

@keyframes scanLine {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    10% { opacity: 0.9; }
    90% { opacity: 0.9; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* ============================================
   LIGHT MODE - Clean Minimal Design
   Readable and professional with subtle color accents
   ============================================ */

[data-theme="light"] .navbar {
    /* NOTE: backdrop-filter removed for battery/CPU optimization */
    background: rgba(255, 255, 255, 0.98);

    /* backdrop-filter REMOVED - causes sustained GPU load and device heating */

    /* Subtle colored bottom border */
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);

    box-shadow:
        /* Soft shadow for depth */
        0 2px 20px rgba(0, 0, 0, 0.08),
        0 4px 40px rgba(0, 0, 0, 0.04);
}

/* Light mode - hide aurora effects for cleaner look */
[data-theme="light"] .nav-aurora::before,
[data-theme="light"] .nav-aurora::after {
    opacity: 0;
}

/* Light mode - subtle scan line */
[data-theme="light"] .nav-scan-line {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(var(--primary-rgb), 0.3) 30%,
        rgba(var(--primary-rgb), 0.5) 50%,
        rgba(var(--primary-rgb), 0.3) 70%,
        transparent 100%
    );
    height: 1px;
    opacity: 0.6;
}

/* ============================================
   NAV CONTENT - Glass panel container
   ============================================ */

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* Nav content has no pseudo-element overlays - clean design */

/* ============================================
   REDUCED MOTION - Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .nav-aurora::before,
    .nav-aurora::after {
        animation: none;
    }

    .nav-scan-line {
        animation: none;
        opacity: 0.5;
        transform: none;
    }

    /* Disable infinite indicator animations for accessibility */
    .nav-link.active .nav-link-indicator {
        animation: none;
    }

    .nav-status-dot {
        animation: none;
    }
}

/* ============================================
   LOGO SECTION
   ============================================ */

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-logo:hover {
    text-decoration: none;
}

/* Logo glow effect - disabled for clean design */
.nav-logo-glow {
    display: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-logo:hover .nav-logo-glow {
    opacity: 1;
}

[data-theme="light"] .nav-logo-glow {
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%);
}

/* Logo images */
.nav-logo-img {
    height: 36px;
    width: auto;
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.4));
}

.nav-logo:hover .nav-logo-img {
    transform: scale(1.08) rotate(-2deg);
    filter: drop-shadow(0 0 16px rgba(var(--primary-rgb), 0.6));
}

/* Theme-based logo display */
.nav-logo-dark { display: block; }
.nav-logo-light { display: none; }

[data-theme="light"] .nav-logo-dark { display: none; }
[data-theme="light"] .nav-logo-light {
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.12));
}

[data-theme="light"] .nav-logo:hover .nav-logo-light {
    filter: drop-shadow(0 4px 16px rgba(var(--primary-rgb), 0.3));
}

/* Brand text */
.nav-brand {
    display: flex;
    align-items: baseline;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-brand-text {
    color: var(--text);
    transition: color 0.3s ease;
}

.nav-brand-accent {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.5);
    transition: all 0.3s ease;
}

.nav-logo:hover .nav-brand-accent {
    text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.8);
}

[data-theme="light"] .nav-brand-accent {
    color: var(--primary);
    text-shadow: none;
}

[data-theme="light"] .nav-logo:hover .nav-brand-accent {
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.4);
}

/* ============================================
   NAV LINKS
   ============================================ */

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    text-decoration: none;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.nav-link:hover {
    color: var(--text);
    text-decoration: none;
}

.nav-link:hover::before {
    opacity: 1;
}

/* Link indicator dot */
.nav-link-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.nav-link:hover .nav-link-indicator {
    background: var(--primary);
    opacity: 1;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.6);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.nav-link.active .nav-link-indicator {
    background: var(--primary);
    opacity: 1;
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.8);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

[data-theme="light"] .nav-link::before {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, transparent 100%);
}

[data-theme="light"] .nav-link:hover .nav-link-indicator,
[data-theme="light"] .nav-link.active .nav-link-indicator {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
}

[data-theme="light"] .nav-link.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
}

/* ============================================
   NAV CONTROLS
   ============================================ */

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-control-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

[data-theme="light"] .nav-control-group {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

.nav-control-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.nav-control-btn i {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    transition: transform 0.3s ease;
}

.nav-control-btn:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.nav-control-btn:hover i {
    transform: scale(1.1);
}

[data-theme="light"] .nav-control-btn:hover {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

/* Pulse effect on buttons - uses theme color */
.nav-control-pulse {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.nav-control-btn:hover .nav-control-pulse {
    opacity: 1;
    transform: scale(1);
}

[data-theme="light"] .nav-control-pulse {
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.2) 0%, transparent 70%);
}

/* Status indicator */
.nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 20px;
}

.nav-status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
    50% { opacity: 0.6; box-shadow: 0 0 16px rgba(34, 197, 94, 0.8); }
}

.nav-status-text {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #22c55e;
    text-transform: uppercase;
}

/* ============================================
   PWA SAFE AREA SUPPORT
   ============================================ */

@supports (padding: env(safe-area-inset-top)) {
    :root {
        --safe-area-top: env(safe-area-inset-top, 0px);
        --safe-area-left: env(safe-area-inset-left, 0px);
        --safe-area-right: env(safe-area-inset-right, 0px);
        --safe-area-bottom: env(safe-area-inset-bottom, 0px);
        --header-total-height: calc(var(--nav-height) + var(--safe-area-top));
    }

    @media all and (display-mode: standalone) {
        .navbar {
            height: var(--header-total-height);
            padding-top: var(--safe-area-top);
        }

        .nav-content {
            padding-left: max(1.5rem, var(--safe-area-left));
            padding-right: max(1.5rem, var(--safe-area-right));
        }

        .container {
            padding-top: calc(var(--header-total-height) + 1rem);
        }
    }

    .container {
        padding-left: max(2rem, var(--safe-area-left));
        padding-right: max(2rem, var(--safe-area-right));
        padding-bottom: max(2rem, var(--safe-area-bottom));
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .navbar {
        --nav-height: 56px;
    }

    .nav-content {
        padding: 0 1rem;
        gap: 1rem;
    }

    .nav-logo-img {
        height: 28px;
    }

    .nav-brand {
        font-size: 0.9rem;
    }

    .nav-links {
        gap: 0;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
    }

    .nav-link-indicator {
        width: 5px;
        height: 5px;
    }

    .nav-control-group {
        padding: 0.125rem;
        gap: 0.125rem;
    }

    .nav-control-btn {
        width: 32px;
        height: 32px;
    }

    .nav-control-btn i {
        font-size: 0.85rem;
    }

    .nav-status {
        display: none;
    }
}

@media (max-width: 480px) {
    /* Show brand text on mobile - scaled down to fit */
    .nav-brand {
        font-size: 0.65rem;
        letter-spacing: 0.04em;
    }

    /* Reduce glow intensity on mobile for cleaner look */
    .nav-brand-accent {
        text-shadow: 0 0 12px rgba(var(--primary-rgb), 0.4);
    }

    .nav-link-text {
        font-size: 0.65rem;
    }

    /* Tighter nav content spacing on small screens */
    .nav-content {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
}

/* ============================================
   CONTAINER (unchanged)
   ============================================ */

[data-theme="dark"] .container::before {
    display: none;
}

/* Main container - Responsive padding with clamp() */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 2rem);
    position: relative;
    z-index: 1;
}

.container::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border-radius: 2rem;
    background: var(--overlay-light);
    box-shadow: inset 0 1px 0 var(--overlay-subtle);
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* Page header */
.page-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem 1.25rem 1.25rem;
    border-radius: 1rem;
    background: var(--surface-hero, var(--gradient-hero));
    box-shadow: var(--surface-hero-glow, var(--shadow-lg));
    border: 1px solid var(--surface-hero-border, var(--border));
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, var(--overlay-subtle), transparent 45%);
    opacity: 0.4;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

/* Tagline rotation system - Terminal-inspired hero */
.tagline-container {
    position: relative;
    min-height: 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.tagline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', monospace;
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--color-text-primary, #1a1a2e);
    white-space: nowrap;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.4s ease-out,
                transform 0.4s ease-out,
                visibility 0.4s;
}

.tagline-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Terminal prompt character */
.tagline-prompt {
    color: var(--primary, #6366f1);
    font-weight: 700;
    margin-right: 0.5rem;
    opacity: 0.9;
}

/* Blinking cursor */
.tagline-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--primary, #6366f1);
    margin-left: 0.25rem;
    vertical-align: text-bottom;
    animation: cursorBlink 1s step-end infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tagline-active .tagline-cursor {
    opacity: 1;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Dark mode adjustments */
[data-theme="dark"] .tagline {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .tagline-prompt {
    color: var(--primary-light, #818cf8);
}

[data-theme="dark"] .tagline-cursor {
    background: var(--primary-light, #818cf8);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tagline {
        transition-duration: 0.01ms !important;
    }
    .tagline-cursor {
        animation: none;
        opacity: 1;
    }
}

/* Legacy subtitle support */
.subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    max-width: 40rem;
    line-height: 1.6;
}

[data-theme="dark"] .subtitle {
    color: rgba(255, 255, 255, 0.85);
}

/* App wrapper */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Feed container */
.feed-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Responsive layout adjustments */
@media (max-width: 1024px) {
    .page-header {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        justify-content: center;
        margin-bottom: 1.5rem;
        padding: 1rem 1.25rem;
    }

    /* Hide tagline on mobile - just show stats pill */
    .header-content {
        display: none;
    }

    .nav-content {
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }
}

/* iPad landscape - show tagline like desktop */
@media (orientation: landscape) and (min-width: 1024px) {
    .header-content {
        display: block;
    }

    .page-header {
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .tagline-container {
        min-height: 3.5rem;
    }

    .tagline {
        font-size: 0.95rem;
        white-space: normal;
    }

    .tagline-prompt {
        margin-right: 0.35rem;
    }
}
