/* ============================================================
   DATATELOMERE.COM - Dark-Neon HUD Monitoring Station
   ============================================================ */

/* Color Palette */
:root {
    --void-black: #06060c;
    --panel-bg: #0a0a10;
    --sidebar-bg: #08080e;
    --border-color: #1b1b30;
    --text-primary: #c0c8d8;
    --text-dim: #5a6580;
    --accent-cyan: #00f0ff;
    --accent-magenta: #ff00aa;
    --accent-green: #39ff14;
    --accent-red: #ff003c;
    --accent-amber: #ffaa00;
    --accent-violet: #8b5cf6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-black);
    color: var(--text-primary);
    font-family: 'Share Tech Mono', monospace;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(27, 27, 48, 0.03) 2px,
            rgba(27, 27, 48, 0.03) 4px
        );
}

/* Status Bars */
.status-bar {
    position: fixed;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    font-family: 'Share Tech Mono', monospace;
    z-index: 1000;
}

#top-bar {
    top: 0;
}

.footer-bar {
    top: auto;
    bottom: 0;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
    justify-content: space-between;
}

.bar-left, .bar-center, .bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.domain-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    font-weight: bold;
}

.utc-timestamp {
    color: var(--text-dim);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.04em;
}

.status-indicator {
    display: inline-block;
    font-size: 1rem;
    margin: 0 0.3rem 0 0.8rem;
}

.status-indicator.integrity {
    color: var(--accent-green);
    animation: pulse-green 2s infinite;
}

.status-indicator.entropy {
    color: var(--accent-amber);
    animation: pulse-amber 2.3s infinite;
}

.status-indicator.telomere {
    color: var(--accent-red);
    animation: pulse-red 2.6s infinite;
}

.status-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-right: 1.5rem;
}

.coordinates {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

.cursor-blink {
    display: inline-block;
    color: var(--accent-cyan);
    animation: blink 1s infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse-amber {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0; }
}

/* Main Container Layout */
.main-container {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    grid-template-rows: 48px 1fr 32px;
    height: 100vh;
    position: relative;
    margin-top: 48px;
}

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-left {
    grid-column: 1;
    grid-row: 2;
    border-left: none;
}

.sidebar-right {
    grid-column: 3;
    grid-row: 2;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

#main-content {
    grid-column: 2;
    grid-row: 2;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: linear-gradient(to bottom, #06060c, #0a0a10);
    scroll-behavior: smooth;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--panel-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Data Panels */
.data-panel {
    min-height: 80vh;
    margin-bottom: 4rem;
    padding: 3rem 2rem;
    border-top: 2px solid;
    opacity: 0;
    animation: panel-fade-in 0.6s ease-out forwards;
    position: relative;
}

.data-panel:nth-child(1) {
    border-top-color: var(--accent-cyan);
}

.data-panel:nth-child(2) {
    border-top-color: var(--accent-magenta);
}

.data-panel:nth-child(3) {
    border-top-color: var(--accent-cyan);
}

.data-panel:nth-child(4) {
    border-top-color: var(--accent-magenta);
}

.data-panel:nth-child(5) {
    border-top-color: var(--accent-cyan);
}

@keyframes panel-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.data-panel.in-view {
    opacity: 1;
}

.panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.panel-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.01em;
}

/* Telomere Chart */
.telomere-chart {
    margin-bottom: 2rem;
    height: 300px;
}

.telomere-chart svg {
    width: 100%;
    height: 100%;
}

.telomere-bar {
    fill-opacity: 0.9;
    transition: fill 0.3s ease;
}

/* Hex Log */
.log-feed {
    height: 400px;
    overflow-y: auto;
    background: rgba(6, 6, 12, 0.5);
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
}

.hex-log {
    font-size: 0.75rem;
    font-family: 'Share Tech Mono', monospace;
    line-height: 1.6;
    color: var(--text-dim);
}

.hex-entry {
    margin-bottom: 0.5rem;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
}

.hex-entry.corrupted {
    color: var(--accent-red);
}

/* Degradation Chart */
.degradation-chart {
    width: 100%;
    height: 300px;
    margin: 2rem 0;
}

.degradation-bar {
    fill-opacity: 0.8;
    transition: fill 0.6s ease;
}

/* Entropy Analysis */
.entropy-comparison {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.entropy-compare-item {
    flex: 1;
    min-width: 300px;
}

.entropy-compare-item h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

.entropy-graph {
    width: 100%;
    height: 150px;
    margin-bottom: 1rem;
}

.entropy-curve {
    fill: none;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.entropy-curve.clean {
    stroke: var(--accent-cyan);
}

.entropy-curve.noisy {
    stroke: var(--accent-red);
}

.entropy-metric {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-magenta);
    margin-top: 1rem;
}

/* Critical Section */
.critical-panel {
    border-top-color: var(--accent-red) !important;
}

.critical-panel .panel-title {
    color: var(--accent-red);
    text-shadow: 0 0 8px rgba(255, 0, 60, 0.4);
}

.shake-trigger {
    transition: all 0.3s ease;
}

.shake-trigger.shaking {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.alarm-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.alarm-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: alarm-pulse 0.8s infinite;
}

@keyframes alarm-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 0, 60, 0.7); }
    50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(255, 0, 60, 0); }
}

.alarm-text {
    color: var(--accent-red);
}

/* Preservation Section */
.preservation-panel {
    border-top-color: var(--accent-green) !important;
}

.preservation-panel .panel-title {
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}

.recovery-gauge {
    width: 300px;
    height: 300px;
    margin: 2rem auto;
}

.gauge-background {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 2;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent-green);
    stroke-width: 3;
    stroke-dasharray: 502.4;
    stroke-dashoffset: 502.4;
    transform-origin: 100px 100px;
    transition: stroke-dashoffset 0.8s linear;
    opacity: 0.8;
}

.gauge-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    text-anchor: middle;
    fill: var(--accent-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
}

.restoration-msg {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
    opacity: 0;
    animation: msg-reveal 1.2s ease-out 0.5s forwards;
}

@keyframes msg-reveal {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Entropy Background */
.entropy-bg {
    width: 100%;
    height: 100px;
    opacity: 0.03;
    margin: 1rem 0;
}

/* Dashboard Panels */
.dashboard-panel {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-panel:last-of-type {
    border-bottom: none;
}

.dashboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    font-weight: 700;
}

.mini-gauge {
    width: 100%;
    height: 120px;
    margin-bottom: 1rem;
}

.gauge-background {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1;
}

.gauge-arc {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 2;
    stroke-linecap: round;
    transition: all 0.3s ease;
}

.gauge-pct {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    text-anchor: middle;
    fill: var(--accent-cyan);
}

.telomere-counter {
    text-align: center;
    padding: 1rem;
    background: rgba(6, 6, 12, 0.5);
    border: 1px solid var(--border-color);
}

.counter-value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-magenta);
    margin-bottom: 0.5rem;
}

.counter-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

.entropy-timeline {
    width: 100%;
    height: 120px;
}

.entropy-line {
    fill: none;
    stroke: var(--accent-green);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

/* Connection Matrix */
.connection-matrix {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(6, 6, 12, 0.5);
    border: 1px solid var(--border-color);
}

.dot-matrix {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.matrix-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--text-dim);
    opacity: 0.3;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.matrix-dot.active {
    background: var(--accent-green);
    opacity: 1;
}

.matrix-dot.failed {
    background: var(--accent-red);
    opacity: 0.8;
    animation: dot-fail 1s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes dot-fail {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.3; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        grid-template-rows: 36px 1fr 24px;
    }

    .sidebar {
        display: none;
    }

    #top-bar {
        height: 36px;
        font-size: 0.7rem;
    }

    .footer-bar {
        height: 24px;
        font-size: 0.65rem;
    }

    #main-content {
        grid-column: 1;
        padding: 1rem;
    }

    .data-panel {
        padding: 1.5rem 1rem;
        min-height: auto;
    }

    .panel-title {
        font-size: 1.5rem;
    }

    .panel-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .panel-title {
        font-size: 1.2rem;
    }

    .entropy-comparison {
        flex-direction: column;
        gap: 1rem;
    }

    .status-label {
        display: none;
    }

    .bar-right {
        flex-direction: column;
        gap: 0.3rem;
    }
}
