@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@300;400;600;700&display=swap');

/* =========================================
   Variables & Theme
   ========================================= */
:root {
    /* Cyber Theme (Default) */
    --bg-color: #050b14;
    --bg-secondary: #0f172a;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary-color: #06b6d4; /* Cyan 500 */
    --primary-glow: rgba(6, 182, 212, 0.5);

    --accent-color: #3b82f6;  /* Blue 500 */
    --success-color: #10b981; /* Emerald 500 */
    --warning-color: #f59e0b; /* Amber 500 */
    --danger-color: #ef4444;  /* Red 500 */

    --panel-bg: rgba(15, 23, 42, 0.6);
    --panel-border: rgba(148, 163, 184, 0.1);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --grid-color: rgba(56, 189, 248, 0.03);
}

body.minimal-theme {
    /* Minimal Theme (Light/Clean) */
    --bg-color: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --primary-color: #0ea5e9; /* Sky 500 */
    --primary-glow: rgba(14, 165, 233, 0.2);

    --panel-bg: rgba(255, 255, 255, 0.9);
    --panel-border: #e2e8f0;

    --grid-color: rgba(0, 0, 0, 0.02);
}

/* =========================================
   Reset & Base
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6, .mono {
    font-family: var(--font-mono);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
body.minimal-theme ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

/* =========================================
   Layout & Grid
   ========================================= */
.grid-bg {
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center top;
}

/* =========================================
   Cyber Components
   ========================================= */

/* Glass Panel / Card */
.glass-panel, .cyber-card {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cyber-card:hover {
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-2px);
}

/* Input Fields */
.cyber-input {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    padding: 0.5rem 1rem;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}
.cyber-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-glow);
}
body.minimal-theme .cyber-input {
    background: #ffffff;
    border-color: #cbd5e1;
}

/* Buttons */
.cyber-btn {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-mono);
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}
.cyber-btn:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Tables */
.cyber-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.cyber-table th {
    text-align: left;
    padding: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--panel-border);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}
.cyber-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-primary);
}
.cyber-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.cyber-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    border-radius: 2px;
    border: 1px solid currentColor;
}
.badge-blue { color: #60a5fa; background: rgba(59, 130, 246, 0.1); }
.badge-green { color: #34d399; background: rgba(16, 185, 129, 0.1); }
.badge-amber { color: #fbbf24; background: rgba(245, 158, 11, 0.1); }
.badge-red { color: #f87171; background: rgba(239, 68, 68, 0.1); }
.badge-cyan { color: #22d3ee; background: rgba(6, 182, 212, 0.1); }

/* =========================================
   Effects & Animations
   ========================================= */

/* Scanline */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.1)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.15;
}
.scan-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, transparent, var(--primary-glow), transparent);
    animation: scan 6s linear infinite;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.2;
}
body.minimal-theme .scan-line,
body.minimal-theme .scan-glow {
    display: none;
}

@keyframes scan {
    0% { top: -10%; }
    100% { top: 110%; }
}

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary-color);
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

/* Fade In */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glitch Text (Simple) */
.glitch-text {
    position: relative;
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}
.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    100% { clip: rect(80px, 9999px, 90px, 0); }
}
@keyframes glitch-anim-2 {
    0% { clip: rect(10px, 9999px, 80px, 0); }
    100% { clip: rect(90px, 9999px, 30px, 0); }
}

/* =========================================
   Utility Classes
   ========================================= */
.text-cyan-glow {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-glow);
}
.border-l-active {
    border-left: 2px solid var(--primary-color);
}

/* =========================================
   Tabs & Portable Cards (New)
   ========================================= */
.tab-btn {
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}
.tab-content.active {
    display: block;
}

.code-block {
    background: #0d1117;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #c9d1d9;
    white-space: pre-wrap;
    overflow-x: auto;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.copy-btn:hover {
    background: var(--primary-color);
    color: #000;
}
