/* ===================================
   MUNJ.UK - Sci-Fi Luxury Command Dashboard
   Gold-on-black luxury interface
   =================================== */

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

:root {
    --gold: #C0A050;
    --warm-gold-grey: #B0A080;
    --muted-gold-grey: #808070;
    --deep-black: #0A0A08;
    --panel-black: #141410;
    --gold-glow: rgba(192, 160, 80, 0.1);
    --highlight-gold: #E0C070;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-black);
    color: var(--warm-gold-grey);
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Floating Elements --- */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    opacity: 0;
    animation: floatDrift linear infinite;
}

.floating-shape--diamond {
    width: 8px;
    height: 8px;
    background: var(--gold);
    transform: rotate(45deg);
}

.floating-shape--circle {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

.floating-shape--line {
    width: 20px;
    height: 1px;
    background: var(--gold);
}

@keyframes floatDrift {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.06;
    }
    90% {
        opacity: 0.06;
    }
    100% {
        transform: translateY(-100px) translateX(80px) rotate(360deg);
        opacity: 0;
    }
}

/* --- Dashboard Viewport --- */
.dashboard-viewport {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    opacity: 0;
    animation: viewportFadeIn 1.2s ease-out 0.3s forwards;
}

@keyframes viewportFadeIn {
    to { opacity: 1; }
}

/* --- Header --- */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border: 1px solid var(--gold);
    background: var(--panel-black);
    opacity: 0;
    animation: panelDrawIn 0.8s ease-out 0.5s forwards;
}

.site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--gold);
    letter-spacing: 0.15em;
    text-align: center;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: var(--muted-gold-grey);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.5;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    flex: 1;
}

/* Panel base styles */
.panel {
    position: relative;
    background: var(--panel-black);
    background-image: linear-gradient(180deg, rgba(192, 160, 80, 0.03) 0%, transparent 40%);
    border: 1px solid var(--gold);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    opacity: 0;
    animation: panelStaggerIn 0.6s ease-out forwards;
    will-change: transform;
}

.panel:active {
    transform: scale(0.97);
}

.panel.panel-bounce {
    transform: scale(1.02);
}

/* Panel sizes */
.panel-featured {
    grid-column: span 6;
    grid-row: span 2;
    animation-delay: 0.7s;
}

.panel-medium {
    grid-column: span 3;
    animation-delay: 0.9s;
}

.panel-tall {
    grid-column: span 3;
    grid-row: span 2;
    animation-delay: 0.8s;
}

.panel-wide {
    grid-column: span 6;
    animation-delay: 1.1s;
}

.panel-small {
    grid-column: span 3;
    animation-delay: 1.0s;
}

.panel-compact {
    grid-column: span 3;
    animation-delay: 1.2s;
}

@keyframes panelStaggerIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelDrawIn {
    from {
        opacity: 0;
        clip-path: inset(0 50% 0 50%);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

/* Panel corners (hand-drawn ornaments) */
.panel-corner {
    position: absolute;
    z-index: 2;
    opacity: 0;
    animation: cornerFadeIn 0.5s ease-out 1.5s forwards;
}

.panel-corner-tl {
    top: 4px;
    left: 4px;
}

.panel-corner-tr {
    top: 4px;
    right: 4px;
}

@keyframes cornerFadeIn {
    to { opacity: 0.7; }
}

.corner-ornament {
    display: block;
}

/* Panel header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(192, 160, 80, 0.15);
}

.panel-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    color: var(--muted-gold-grey);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.panel-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    animation: indicatorPulse 2s ease-in-out infinite;
}

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

/* Panel content */
.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--gold);
    margin-bottom: 4px;
}

.panel-body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: var(--warm-gold-grey);
    line-height: 1.85;
}

/* Data rows */
.panel-data-row,
.coord-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(192, 160, 80, 0.08);
}

.data-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--muted-gold-grey);
    letter-spacing: 0.1em;
}

.data-value {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--warm-gold-grey);
}

.data-value.highlight {
    color: var(--highlight-gold);
}

/* Panel glow (featured panel) */
.panel-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: radial-gradient(ellipse at center bottom, var(--gold-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    animation: glowPulse 4s ease-in-out infinite 2s;
}

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

/* --- Network Visualization --- */
.network-viz {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.network-svg {
    width: 100%;
    max-height: 120px;
}

/* --- Activity Log --- */
.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(192, 160, 80, 0.06);
}

.log-time {
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    color: var(--muted-gold-grey);
    flex-shrink: 0;
    min-width: 60px;
}

.log-msg {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.82rem;
    color: var(--warm-gold-grey);
    line-height: 1.5;
}

/* --- Metrics Bars --- */
.metric-bar-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.metric-bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.metric-bar {
    height: 4px;
    background: rgba(192, 160, 80, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--highlight-gold));
    border-radius: 2px;
    transform-origin: left;
    transform: scaleX(0);
    animation: barFillIn 1.2s ease-out 1.8s forwards;
}

@keyframes barFillIn {
    to { transform: scaleX(1); }
}

/* --- Transmission Grid --- */
.transmission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.transmission-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* --- Intel Stats --- */
.intel-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
}

.intel-number {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: var(--gold);
}

.intel-desc {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--muted-gold-grey);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Waveform Canvas --- */
#waveform-canvas {
    width: 100%;
    height: 100px;
    display: block;
}

/* --- Footer --- */
.dashboard-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    border: 1px solid var(--gold);
    background: var(--panel-black);
    opacity: 0;
    animation: panelDrawIn 0.8s ease-out 1.4s forwards;
}

.footer-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--muted-gold-grey);
    letter-spacing: 0.1em;
}

.footer-separator {
    color: rgba(192, 160, 80, 0.3);
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .panel-featured {
        grid-column: span 6;
        grid-row: span 1;
    }

    .panel-wide {
        grid-column: span 6;
    }

    .panel-tall {
        grid-column: span 3;
        grid-row: span 1;
    }

    .panel-medium,
    .panel-small,
    .panel-compact {
        grid-column: span 3;
    }
}

@media (max-width: 640px) {
    .dashboard-viewport {
        padding: 10px;
        gap: 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .panel-featured,
    .panel-medium,
    .panel-tall,
    .panel-wide,
    .panel-small,
    .panel-compact {
        grid-column: span 1;
        grid-row: span 1;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .header-left,
    .header-right {
        justify-content: center;
    }

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

    .dashboard-footer {
        flex-wrap: wrap;
        justify-content: center;
    }
}
