/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #0A0A0F;
    color: #C0C0D0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}

/* Typography */
h1, h2, h3 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    letter-spacing: 0.08em;
}

h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.15em;
}

h2 {
    font-size: clamp(1.6rem, 4vw, 3.2rem);
}

h3 {
    font-size: 1.1rem;
}

code, .monospace {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
}

/* Dashboard Container */
.dashboard-container {
    display: grid;
    grid-template-columns: 55fr 45fr;
    grid-template-rows: 1fr;
    width: 100dvw;
    height: 100dvh;
    gap: 0;
    border: 1px solid rgba(192, 192, 208, 0.2);
}

/* Divider Lines */
.dashboard-container::before {
    content: '';
    position: absolute;
    left: 55%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(192, 192, 208, 0.4);
    z-index: 10;
}

.right-panels::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    right: 0;
    height: 1px;
    background-color: rgba(192, 192, 208, 0.4);
    z-index: 10;
}

/* Primary Viewport (Left Panel) */
.primary-viewport {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-right: 1px solid rgba(192, 192, 208, 0.4);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #16161F;
}

.primary-viewport::-webkit-scrollbar {
    width: 8px;
}

.primary-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.primary-viewport::-webkit-scrollbar-thumb {
    background: rgba(192, 192, 208, 0.3);
    border-radius: 4px;
}

.primary-viewport::-webkit-scrollbar-thumb:hover {
    background: rgba(192, 192, 208, 0.5);
}

/* Domain Header */
.domain-header {
    margin-bottom: clamp(2rem, 5vw, 4rem);
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(192, 192, 208, 0.2);
}

.domain-name {
    color: #C0C0D0;
    text-transform: lowercase;
    font-style: italic;
}

/* Navigation */
.section-nav {
    display: flex;
    gap: clamp(1rem, 3vw, 2rem);
    margin-bottom: clamp(2rem, 3vw, 3rem);
    border-bottom: 1px solid rgba(192, 192, 208, 0.2);
    padding-bottom: 1rem;
}

.nav-link {
    color: #8A8A9A;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid transparent;
    padding-bottom: 0.5rem;
    transition: color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: #C0C0D0;
    border-bottom-color: #3A7BD4;
}

/* Viewport Content */
.viewport-content {
    flex: 1;
}

.content-section {
    margin-bottom: 3rem;
    scroll-margin-top: 2rem;
}

.section-title {
    color: #E8E8F0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(192, 192, 208, 0.2);
}

.description-text {
    color: #8A8A9A;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

.section-content {
    padding-left: 1rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.content-block {
    padding: 1rem;
    background-color: rgba(18, 18, 31, 0.5);
    border-left: 2px solid #3A7BD4;
    border-radius: 0;
}

.content-block h3 {
    color: #C0C0D0;
    margin-bottom: 0.5rem;
}

.content-block p {
    color: #8A8A9A;
    font-size: 0.9rem;
}

/* Taxonomy List */
.taxonomy-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.taxonomy-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: rgba(18, 18, 31, 0.5);
    border-left: 2px solid #3A7BD4;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
}

.taxonomy-label {
    color: #C0C0D0;
}

.taxonomy-count {
    color: #8A8A9A;
}

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

.feed-item {
    padding: 1rem;
    background-color: rgba(18, 18, 31, 0.5);
    border-left: 2px solid #3A7BD4;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}

.feed-time {
    color: #8A8A9A;
    margin-bottom: 0.5rem;
}

.feed-event {
    color: #C0C0D0;
    margin-bottom: 0.5rem;
}

.feed-severity {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.severity-high {
    color: #D43A3A;
    background-color: rgba(212, 58, 58, 0.1);
}

.severity-medium {
    color: #D4713A;
    background-color: rgba(212, 113, 58, 0.1);
}

.severity-warning {
    color: #C0C0C0;
    background-color: rgba(192, 192, 192, 0.1);
}

/* Right Panels Container */
.right-panels {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    position: relative;
    border-left: 1px solid rgba(192, 192, 208, 0.4);
}

/* Panel Styles */
.panel {
    display: flex;
    flex-direction: column;
    background-color: #12121F;
    overflow: hidden;
    position: relative;
}

.panel-header {
    padding: clamp(1rem, 2vw, 1.5rem);
    border-bottom: 1px solid rgba(192, 192, 208, 0.4);
}

.panel-title {
    color: #E8E8F0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel-content {
    flex: 1;
    padding: clamp(1rem, 2vw, 1.5rem);
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(192, 192, 208, 0.2);
}

/* Telemetry Panel */
.telemetry-panel {
    border-bottom: 1px solid rgba(192, 192, 208, 0.4);
}

.data-stream {
    width: 100%;
    height: 120px;
    margin-bottom: 1.5rem;
    display: block;
}

.data-stream path {
    fill: none;
    stroke-width: 2;
    filter: url(#glow);
}

.telemetry-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: 'IBM Plex Mono', monospace;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(192, 192, 208, 0.2);
    font-size: 0.9rem;
}

.stat-label {
    color: #8A8A9A;
}

.stat-value {
    color: #3A7BD4;
    font-weight: 600;
}

/* Status Panel */
.status-panel {
    border-top: 1px solid rgba(192, 192, 208, 0.4);
}

.status-matrix {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(18, 18, 31, 0.5);
    border-left: 2px solid rgba(58, 123, 212, 0.3);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}

.status-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

.status-active {
    background-color: #3A7BD4;
    box-shadow: 0 0 6px rgba(58, 123, 212, 0.8);
}

.status-idle {
    background-color: #8A8A9A;
    box-shadow: 0 0 4px rgba(138, 138, 154, 0.5);
    animation: none;
}

.status-warning {
    background-color: #D43A3A;
    box-shadow: 0 0 6px rgba(212, 58, 58, 0.8);
}

.status-label {
    color: #C0C0D0;
    flex: 1;
}

.system-message {
    padding: 1rem;
    background-color: rgba(58, 123, 212, 0.1);
    border-left: 2px solid #3A7BD4;
    border-radius: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #8A8A9A;
    line-height: 1.6;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes glitch {
    0%, 100% {
        text-shadow: -2px 0 #D43A3A, 2px 0 #3A7BD4;
    }
    50% {
        text-shadow: 2px 0 #D43A3A, -2px 0 #3A7BD4;
    }
}

/* Responsive Typography Adjustments */
@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .dashboard-container::before {
        left: 0;
        right: 0;
        top: 50%;
        width: auto;
        height: 1px;
    }

    .primary-viewport {
        border-right: none;
        border-bottom: 1px solid rgba(192, 192, 208, 0.4);
    }

    .right-panels {
        grid-template-rows: 1fr;
    }

    .right-panels::before {
        display: none;
    }

    .telemetry-panel {
        border-bottom: none;
        border-right: 1px solid rgba(192, 192, 208, 0.4);
    }

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

/* Glitch Effect Canvas */
#glitch-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    pointer-events: none;
    opacity: 0.02;
    z-index: 100;
}
