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

:root {
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Fantasque Sans Mono', Courier, monospace;

    /* Theme variables - Default Dark Mode (Enigmatic and Cyberpunk) */
    --bg-gradient: radial-gradient(circle at 50% 50%, #0d0b18 0%, #050409 100%);
    --panel-bg: rgba(10, 9, 18, 0.92);
    --panel-border: rgba(139, 92, 246, 0.2);
    --panel-border-hover: rgba(139, 92, 246, 0.45);
    --glow-color: rgba(139, 92, 246, 0.15);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #a78bfa;
    --accent-glow: #8b5cf6;
    --terminal-green: #34d399;
    --terminal-green-glow: rgba(52, 211, 153, 0.35);
    --terminal-text: #34d399;
    --status-green: #10b981;
    --status-orange: #f59e0b;
    --status-red: #ef4444;
    --scrollbar-thumb: rgba(139, 92, 246, 0.3);
}

/* Light Theme Variables overrides */
.light-theme {
    --bg-gradient: radial-gradient(circle at 50% 50%, #f0f4ff 0%, #e2e8f0 100%);
    --panel-bg: rgba(241, 245, 249, 0.95);
    --panel-border: rgba(99, 102, 241, 0.2);
    --panel-border-hover: rgba(99, 102, 241, 0.45);
    --glow-color: rgba(99, 102, 241, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #4f46e5;
    --accent-glow: #6366f1;
    --terminal-green: #059669;
    --terminal-green-glow: rgba(5, 150, 105, 0.25);
    --terminal-text: #0f172a;
    --status-green: #10b981;
    --status-orange: #d97706;
    --status-red: #dc2626;
    --scrollbar-thumb: rgba(99, 102, 241, 0.3);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    transition: background 0.5s ease, color 0.3s ease;
}



/* Floating Monolith Container */
.monolith {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    height: 680px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), 
                0 0 15px 0 var(--glow-color);
    display: flex;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.monolith:hover {
    border-color: var(--panel-border-hover);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), 
                0 0 25px 0 var(--glow-color);
}

/* Left Pane: Dashboard */
.dashboard-pane {
    flex: 1.1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--panel-border);
    overflow-y: auto;
}

.dashboard-header {
    margin-bottom: 30px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.cryptic-symbol {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -2px;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.service-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.light-theme .service-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.light-theme .service-card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.service-card:hover::before {
    opacity: 1;
}

.service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.service-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.service-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
}

.service-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.service-dot.online {
    background: var(--status-green);
    box-shadow: 0 0 8px var(--status-green);
}

.service-dot.offline {
    background: var(--status-red);
    box-shadow: 0 0 8px var(--status-red);
}

.service-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-bottom: 6px;
}

.service-url {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    margin-top: auto;
}

/* Footer Section */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    margin-top: auto;
}

.light-theme .dashboard-footer {
    border-top-color: rgba(0, 0, 0, 0.05);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulsing-green {
    background: var(--status-green);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Right Pane: Terminal */
.terminal-pane {
    flex: 0.9;
    background: rgba(5, 4, 9, 0.85);
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    position: relative;
    overflow: hidden;
}

.light-theme .terminal-pane {
    background: rgba(248, 250, 252, 0.9);
    border-left: 1px solid var(--panel-border);
}



.terminal-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 3;
}

.light-theme .terminal-header {
    background: rgba(226, 232, 240, 0.8);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.terminal-controls {
    display: flex;
    gap: 6px;
    margin-right: 16px;
}

.terminal-controls .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-controls .red { background: #ef4444; }
.terminal-controls .yellow { background: #f59e0b; }
.terminal-controls .green { background: #10b981; }

.terminal-title {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.terminal-output {
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--terminal-text);
}

.terminal-output div {
    margin-bottom: 6px;
    line-height: 1.4;
}

.terminal-output .error {
    color: var(--status-red);
}

.terminal-output .success {
    color: var(--status-green);
}

.terminal-output .info {
    color: var(--accent);
}

.terminal-output .system {
    color: var(--text-secondary);
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.prompt {
    color: var(--accent);
    font-weight: 600;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    caret-shape: block;
}

/* Theme Toggle Button Styling */
.theme-toggle-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.theme-toggle-btn:hover {
    border-color: var(--panel-border-hover);
    transform: scale(1.05);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

/* Show/Hide Theme Icons */
.light-theme .sun-icon {
    display: none;
}

body:not(.light-theme) .moon-icon {
    display: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Responsive Design */
@media (max-width: 900px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .monolith {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 80px);
        margin-top: 50px;
    }

    .dashboard-pane {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
        padding: 24px;
    }

    .terminal-pane {
        flex: none;
        height: 380px;
        border-left: none;
    }

    .theme-toggle-btn {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 550px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* Reduced Motion preferences */
@media (prefers-reduced-motion: reduce) {
    .pulsing-green {
        animation: none;
    }
    .service-card {
        transition: none;
        transform: none !important;
    }
    body {
        transition: none;
    }
    .monolith {
        box-shadow: none !important;
    }
}
