/**
 * LUCIDMIR.AI - Shared Module Header Styles
 * 
 * This is the canonical CSS for all module pages.
 * Include this file instead of duplicating header styles.
 * 
 * Required CSS Variables (define in your page):
 *   --void: #02040a;
 *   --text: #e2e8f0;
 *   --dim: #475569;
 *   --signal: #00f0ff;
 *   --alert: #ff4400;
 *   --glass: rgba(2, 4, 10, 0.85);
 */

/* === HUD HEADER === */
.hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}

/* === BRAND (Left) === */
.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    justify-self: start;
}

.nav-logo-svg {
    width: 32px;
    height: 32px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.3));
}
.nav-logo-svg:hover {
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.7));
    transform: scale(1.05);
}

.brand-text {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-text .weight-heavy {
    font-weight: 900;
}
.brand-text .kanji {
    color: var(--alert);
    font-weight: 400;
    font-size: 1.2rem;
}
.brand-text .pipe {
    color: var(--dim);
    opacity: 0.5;
}

/* === MODULES LINK (Center) === */
.modules-link {
    justify-self: center;
    font-size: 0.75rem;
    color: var(--dim);
    text-decoration: none;
    letter-spacing: 0.15em;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
}
.modules-link:hover {
    color: var(--signal);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    border-color: rgba(0, 240, 255, 0.3);
}

/* === STATUS BADGE (Right) === */
.status-badge {
    justify-self: end;
    font-size: 0.7rem;
    color: var(--signal);
    letter-spacing: 0.1em;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(0, 240, 255, 0.3);
    white-space: nowrap;
}

/* Experimental (orange, pulsing) */
.status-badge.experimental,
.status-badge[data-status="experimental"] {
    color: var(--alert);
    border-color: var(--alert);
    animation: danger-pulse 1.5s infinite;
}

/* Active (cyan, stable) */
.status-badge.active,
.status-badge[data-status="active"] {
    color: var(--signal);
    border-color: var(--signal);
    animation: none;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

@keyframes danger-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 68, 0, 0.4);
        border-color: var(--alert);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 68, 0, 0.8), 0 0 40px rgba(255, 23, 68, 0.4);
        border-color: #ff1744;
    }
}

/* === MODULE TITLE (Below HUD) === */
.module-title {
    position: fixed;
    top: 80px;
    left: 2rem;
    z-index: 100;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text);
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    pointer-events: none;
}
.module-title .accent {
    color: var(--signal);
}

/* === RESPONSIVE BREAKPOINTS === */
/* Copied exactly from working modules.html */

/* 768px - Tablet */
@media (max-width: 768px) {
    .module-title {
        top: 72px;
        left: 1rem;
        font-size: 1.2rem;
    }
}

/* 600px - Primary mobile */
@media (max-width: 600px) {
    .hud {
        padding: 0 0.75rem;
        height: 56px;
    }
    .brand-wrapper {
        gap: 0.5rem;
    }
    .brand-text {
        font-size: 0.85rem;
        gap: 0.3rem;
    }
    /* Hide kanji on mobile - too cramped */
    .brand-text .kanji,
    .brand-text .pipe {
        display: none;
    }
    .modules-link {
        font-size: 0.6rem;
        padding: 0.3rem 0.5rem;
        letter-spacing: 0.08em;
    }
    .status-badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.35rem;
        letter-spacing: 0.05em;
    }
}

/* 480px - Small mobile */
@media (max-width: 480px) {
    .hud {
        padding: 0 0.5rem;
    }
    .brand-text {
        font-size: 0.75rem;
    }
    .nav-logo-svg {
        width: 24px;
        height: 24px;
    }
    .modules-link {
        font-size: 0.5rem;
        padding: 0.25rem 0.4rem;
        letter-spacing: 0.05em;
    }
    .status-badge {
        font-size: 0.45rem;
        padding: 0.12rem 0.25rem;
    }
}

/* 380px - Very small */
@media (max-width: 380px) {
    .brand-text {
        font-size: 0.65rem;
    }
    .nav-logo-svg {
        width: 20px;
        height: 20px;
    }
    .modules-link {
        font-size: 0.45rem;
    }
    .status-badge {
        font-size: 0.4rem;
    }
}

/* ============================================
   OVERLAY CLOSE PATTERN - Standardized
   ============================================
   Use this pattern for all modal/overlay close buttons.
   Shows: × icon + [ CLOSE ] label on desktop
          × icon prominent on mobile
   Minimum 44×44px tap target for accessibility.
*/

/* --- Overlay Header Rail --- */
.overlay-header-rail {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 
             calc(0.75rem + env(safe-area-inset-right, 0px)) 
             0.75rem 
             0.75rem;
    background: rgba(2, 4, 10, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    margin: -2rem -2rem 1.5rem -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.overlay-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text, #e2e8f0);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Standard Close Button --- */
.overlay-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 1rem;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: var(--dim, #475569);
    font-family: inherit;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.overlay-close-btn:hover {
    color: var(--signal, #00f0ff);
    border-color: var(--signal, #00f0ff);
    background: rgba(0, 240, 255, 0.08);
}

.overlay-close-btn:active {
    transform: translateY(1px);
}

/* Close icon (×) */
.overlay-close-icon {
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 300;
}

/* Close label text */
.overlay-close-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- Icon-only close (for compact spaces) --- */
.overlay-close-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: var(--dim, #475569);
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.overlay-close-icon-only:hover {
    color: var(--signal, #00f0ff);
    border-color: var(--signal, #00f0ff);
    background: rgba(0, 240, 255, 0.08);
}

.overlay-close-icon-only:active {
    transform: translateY(1px);
}

/* --- Mobile Responsive --- */
@media (max-width: 600px) {
    .overlay-header-rail {
        padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 
                 calc(1rem + env(safe-area-inset-right, 0px)) 
                 0.75rem 
                 1rem;
        margin: -1rem -1rem 1rem -1rem;
    }
    
    .overlay-header-title {
        font-size: 1rem;
    }
    
    /* On mobile, hide label and show only icon for space */
    .overlay-close-btn .overlay-close-label {
        display: none;
    }
    
    .overlay-close-btn {
        padding: 0.5rem;
        min-width: 44px;
        width: 44px;
    }
    
    .overlay-close-btn .overlay-close-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 380px) {
    .overlay-header-title {
        font-size: 0.85rem;
    }
}
