/* =============================================
   bada.cafe - Glassmorphic HUD Command Center
   ============================================= */

/* CSS Custom Properties */
:root {
    --void-bg: #0A1628;
    --atmosphere-start: #0F2440;
    --atmosphere-end: #061220;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(168, 218, 255, 0.18);
    --glass-hover: rgba(255, 255, 255, 0.14);
    --glass-strong: rgba(255, 255, 255, 0.12);
    --primary-text: #E8F4FD;
    --secondary-text: #B8D4E8;
    --tertiary-text: #8BAFC8;
    --accent-glow: #A8DAFF;
    --success-signal: #7DFFC2;
    --caution-signal: #FFD07A;
    --highlight-frost: rgba(168, 218, 255, 0.12);
    --sidebar-glass: rgba(10, 22, 40, 0.7);
    --section-heading-color: #D0E8F5;
    --sidebar-width: 240px;
    --ticker-height: 28px;
    --panel-radius: 16px;
    --grid-gap: 20px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--void-bg);
    color: var(--primary-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   Data Ticker (Top Marquee)
   ============================================= */
#data-ticker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ticker-height);
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    overflow: hidden;
    border-bottom: 1px solid rgba(168, 218, 255, 0.1);
}

.ticker-content {
    display: flex;
    gap: 48px;
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
    padding-top: 6px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--tertiary-text);
    text-transform: uppercase;
}

.ticker-content span {
    flex-shrink: 0;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =============================================
   Sidebar Navigation
   ============================================= */
#sidebar {
    position: fixed;
    left: 0;
    top: var(--ticker-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--ticker-height));
    background: var(--sidebar-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
}

.sidebar-logo {
    margin-bottom: 48px;
}

.sidebar-logo .logo-icon {
    filter: drop-shadow(0 0 8px rgba(168, 218, 255, 0.4));
}

.sidebar-nav-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--tertiary-text);
    transition: color 0.3s ease, filter 0.3s ease;
    padding: 8px;
    border-radius: 12px;
}

.nav-item svg {
    transition: filter 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-glow);
}

.nav-item:hover svg,
.nav-item.active svg {
    filter: drop-shadow(0 0 8px rgba(168, 218, 255, 0.6));
}

.nav-item.active {
    background: var(--highlight-frost);
}

.nav-label {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.status-ring .status-ring-progress {
    animation: ringPulse 8s linear infinite;
    transform-origin: center;
}

@keyframes ringPulse {
    0% { stroke-dashoffset: 25.13; }
    50% { stroke-dashoffset: 75.40; }
    100% { stroke-dashoffset: 25.13; }
}

.status-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--success-signal);
    text-transform: uppercase;
}

/* =============================================
   Mobile Tab Bar
   ============================================= */
#mobile-tabbar {
    display: none;
}

/* =============================================
   Main Content Area
   ============================================= */
#main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--ticker-height);
    position: relative;
    min-height: calc(100vh - var(--ticker-height));
}

/* =============================================
   Scan Lines Overlay
   ============================================= */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(168, 218, 255, 0.03) 3px,
        rgba(168, 218, 255, 0.03) 4px
    );
}

/* =============================================
   Floating Particles
   ============================================= */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-glow);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleDrift 60s linear infinite;
}

@keyframes particleDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(80px, -120px); }
    50% { transform: translate(-40px, -200px); }
    75% { transform: translate(60px, -80px); }
    100% { transform: translate(0, 0); }
}

/* =============================================
   Deck Sections (Viewport-Height)
   ============================================= */
.deck {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.8s ease;
    padding: 60px 40px;
}

.deck-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 10;
}

/* =============================================
   Glass Panel System
   ============================================= */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--panel-radius);
    padding: 32px;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
    animation: borderShimmer 4s ease-in-out infinite alternate;
}

.glass-panel:hover {
    background: var(--glass-hover);
}

@keyframes borderShimmer {
    0% { border-color: rgba(168, 218, 255, 0.18); }
    100% { border-color: rgba(168, 218, 255, 0.28); }
}

.primary-panel {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background: var(--glass-strong);
    min-height: 300px;
}

.secondary-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tertiary-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Corner Brackets */
.panel-corner {
    position: absolute;
    width: 12px;
    height: 12px;
}

.panel-corner::before,
.panel-corner::after {
    content: '';
    position: absolute;
    background: rgba(168, 218, 255, 0.3);
}

.panel-corner::before {
    width: 12px;
    height: 2px;
}

.panel-corner::after {
    width: 2px;
    height: 12px;
}

.panel-corner.tl { top: -1px; left: -1px; }
.panel-corner.tl::before { top: 0; left: 0; }
.panel-corner.tl::after { top: 0; left: 0; }

.panel-corner.tr { top: -1px; right: -1px; }
.panel-corner.tr::before { top: 0; right: 0; }
.panel-corner.tr::after { top: 0; right: 0; }

.panel-corner.bl { bottom: -1px; left: -1px; }
.panel-corner.bl::before { bottom: 0; left: 0; }
.panel-corner.bl::after { bottom: 0; left: 0; }

.panel-corner.br { bottom: -1px; right: -1px; }
.panel-corner.br::before { bottom: 0; right: 0; }
.panel-corner.br::after { bottom: 0; right: 0; }

/* =============================================
   Typography
   ============================================= */
.display-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 72px;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--primary-text);
}

.section-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 24px;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--section-heading-color);
    margin-bottom: 12px;
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    letter-spacing: 0.005em;
    line-height: 1.65;
    color: var(--secondary-text);
}

.micro-label {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tertiary-text);
    display: block;
    margin-top: 8px;
}

.accent-numeric {
    font-family: 'Inter', sans-serif;
    font-weight: 200;
    font-size: 72px;
    color: #FFFFFF;
    text-shadow: 0 0 20px rgba(168, 218, 255, 0.4);
    line-height: 1;
    display: block;
}

.large-numeric {
    font-size: 56px;
}

.mono-readout {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--accent-glow);
    display: block;
}

.panel-icon {
    margin-bottom: 16px;
    filter: drop-shadow(0 0 6px rgba(168, 218, 255, 0.3));
}

.panel-icon.large {
    margin-bottom: 24px;
}

/* =============================================
   Deck Alpha - Welcome Transponder
   ============================================= */
#deck-alpha {
    background: var(--atmosphere-start);
}

#deck-alpha .deck-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto;
    align-items: center;
    justify-items: center;
}

.welcome-center {
    grid-column: 1 / 13;
    text-align: center;
    margin-bottom: 40px;
}

.welcome-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tertiary-text);
    margin-top: 16px;
}

.micro-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 120px;
    grid-column: span 2;
    opacity: 0;
    transform: scale(0.85) translateY(30px);
}

.micro-panel.visible {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
    margin-bottom: 4px;
}

.signal-bars .bar {
    width: 6px;
    background: var(--accent-glow);
    border-radius: 2px;
}

.bar-1 { height: 20%; }
.bar-2 { height: 40%; }
.bar-3 { height: 60%; }
.bar-4 { height: 80%; }
.bar-5 { height: 100%; }

.status-ring-large {
    margin-bottom: 4px;
}

.ring-animate {
    animation: ringRotate 8s linear infinite;
    transform-origin: center;
}

@keyframes ringRotate {
    0% { stroke-dashoffset: 53.41; }
    50% { stroke-dashoffset: 160.22; }
    100% { stroke-dashoffset: 53.41; }
}

/* =============================================
   Deck Beta - Systems Overview (Bento Grid)
   ============================================= */
#deck-beta {
    background: var(--void-bg);
}

.bento-grid {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(180px, auto);
}

.bento-grid .glass-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-grid .glass-panel[data-col="1 / 7"] {
    grid-column: 1 / 7;
}

.bento-grid .glass-panel[data-col="7 / 10"] {
    grid-column: 7 / 10;
}

.bento-grid .glass-panel[data-col="10 / 13"] {
    grid-column: 10 / 13;
}

.bento-grid .glass-panel[data-col="1 / 5"] {
    grid-column: 1 / 5;
}

.bento-grid .glass-panel[data-col="5 / 13"] {
    grid-column: 5 / 13;
}

.bento-grid .glass-panel[data-row="1 / 3"] {
    grid-row: 1 / 3;
}

.bento-grid .glass-panel[data-row="3 / 5"] {
    grid-row: 3 / 5;
}

/* =============================================
   Deck Gamma - Signal Analysis
   ============================================= */
#deck-gamma {
    background: var(--void-bg);
}

#dot-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(168, 218, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 2;
}

.gamma-grid {
    grid-template-columns: 1fr 10fr 1fr;
    align-items: center;
}

.gamma-readout-left,
.gamma-readout-right {
    min-height: 200px;
}

.gamma-main {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.waveform-container {
    flex: 1;
    display: flex;
    align-items: center;
    margin-top: 16px;
}

#waveform-svg {
    width: 100%;
    height: 200px;
}

.waveform-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

/* =============================================
   Deck Delta - Transmission Log
   ============================================= */
#deck-delta {
    background: #0D1E35;
}

.delta-grid {
    grid-template-columns: 1fr;
    gap: 16px;
}

.deck-title {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 56px;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--primary-text);
    margin-bottom: 24px;
}

.log-entry {
    display: grid;
    grid-template-columns: 180px 40px 1fr;
    gap: 20px;
    align-items: center;
    padding: 24px 32px;
    min-height: auto;
}

.log-timestamp {
    display: flex;
    align-items: center;
}

.log-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-title {
    margin-bottom: 4px;
}

/* =============================================
   Deck Epsilon - Open Channel
   ============================================= */
#deck-epsilon {
    background: var(--void-bg);
}

.epsilon-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 40px;
}

.epsilon-panel {
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px;
}

.epsilon-title {
    font-size: 48px;
    margin-bottom: 16px;
}

.epsilon-desc {
    margin-bottom: 32px;
    max-width: 400px;
}

.cta-button {
    position: relative;
    background: transparent;
    border: 1px solid var(--accent-glow);
    color: var(--accent-glow);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 16px 40px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    background: rgba(168, 218, 255, 0.15);
    box-shadow: 0 0 20px rgba(168, 218, 255, 0.3), inset 0 0 20px rgba(168, 218, 255, 0.1);
}

.cta-button:active {
    transform: scale(0.97);
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(168, 218, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
}

.cta-button:hover .btn-glow {
    width: 300px;
    height: 300px;
}

.epsilon-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ring-animate-final {
    transition: stroke-dashoffset 2s ease-out;
}

/* =============================================
   Bounce Enter Animation
   ============================================= */
@keyframes bounceEnter {
    0% { opacity: 0; transform: scale(0.85) translateY(30px); }
    50% { opacity: 1; transform: scale(1.03) translateY(-4px); }
    70% { transform: scale(0.98) translateY(2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.panel-animate {
    opacity: 0;
    transform: scale(0.85) translateY(30px);
}

.panel-animate.visible {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Delta slide-in from left */
.log-entry.panel-animate {
    opacity: 0;
    transform: translateX(-60px);
}

.log-entry.panel-animate.visible {
    animation: slideInLeft 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-60px); }
    50% { opacity: 1; transform: translateX(8px); }
    70% { transform: translateX(-3px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* =============================================
   Responsive Design
   ============================================= */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    #sidebar {
        display: none;
    }

    #mobile-tabbar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background: var(--sidebar-glass);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid var(--glass-border);
        z-index: 100;
        justify-content: space-around;
        align-items: center;
        padding: 0 8px;
    }

    .tab-item {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 12px;
        color: var(--tertiary-text);
        text-decoration: none;
        transition: color 0.3s ease, background 0.3s ease;
    }

    .tab-item:hover,
    .tab-item.active {
        color: var(--accent-glow);
        background: var(--highlight-frost);
    }

    .tab-item.active svg {
        filter: drop-shadow(0 0 8px rgba(168, 218, 255, 0.6));
    }

    #main-content {
        margin-left: 0;
        padding-bottom: 80px;
    }

    .deck {
        padding: 40px 16px;
    }

    .deck-grid {
        grid-template-columns: 1fr;
    }

    .display-heading {
        font-size: 48px;
    }

    .deck-title {
        font-size: 36px;
    }

    .epsilon-title {
        font-size: 32px;
    }

    .micro-panel {
        grid-column: span 1;
    }

    .bento-grid .glass-panel[data-col] {
        grid-column: 1 / -1;
    }

    .bento-grid .glass-panel[data-row] {
        grid-row: auto;
    }

    .gamma-grid {
        grid-template-columns: 1fr;
    }

    .gamma-readout-left,
    .gamma-readout-right {
        min-height: auto;
    }

    .log-entry {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .log-timestamp {
        order: -1;
    }

    .log-icon {
        display: none;
    }

    .accent-numeric {
        font-size: 48px;
    }

    .large-numeric {
        font-size: 40px;
    }

    #deck-alpha .deck-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .welcome-center {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .display-heading {
        font-size: 36px;
    }

    .epsilon-title {
        font-size: 28px;
    }

    #deck-alpha .deck-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Reduced Motion
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .particle {
        animation: none;
    }

    .ticker-content {
        animation: none;
    }

    .ring-animate,
    .ring-animate-final,
    .status-ring .status-ring-progress {
        animation: none;
    }

    .panel-animate,
    .micro-panel {
        opacity: 1;
        transform: none;
    }

    .panel-animate.visible,
    .micro-panel.visible {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .glass-panel {
        animation: none;
    }
}
