:root {
    /* Base spacing & radius */
    --radius-lg: 1.25rem;
    --radius-md: 0.75rem;
    
    /* Default (Cyber) */
    --bg-dark: #05050e;
    --bg-card: rgba(10, 10, 15, 0.7);
    --text-primary: #f2f2f2;
    --text-secondary: #a0a0a0;
    --accent-primary: #00f3ff;
    --accent-secondary: #bc13fe;
    --border-base: rgba(255, 255, 255, 0.08);
    --font-main: 'Rajdhani', sans-serif;
    --font-cyber: 'Orbitron', sans-serif;
    --scanline-opacity: 0.1;
    --grid-opacity: 0.3;
}

/* THEME: TERMINAL (UNIX CRT) */
body.theme-terminal {
    --bg-dark: #0a0a0a;
    --bg-card: rgba(0, 20, 0, 0.8);
    --text-primary: #00ff9d;
    --text-secondary: #008f55;
    --accent-primary: #00ff9d;
    --accent-secondary: #00aa00;
    --border-base: rgba(0, 255, 157, 0.3);
    --font-main: 'Courier New', monospace;
    --font-cyber: 'Courier New', monospace;
    --scanline-opacity: 0.4;
    --grid-opacity: 0.1;
}

/* THEME: FLOW (MODERN PROFESSIONAL) */
body.theme-flow {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --border-base: rgba(0, 0, 0, 0.08);
    --font-main: 'Inter', system-ui, sans-serif;
    --font-cyber: 'Inter', system-ui, sans-serif;
    --scanline-opacity: 0;
    --grid-opacity: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}

h1, h2, h3, h4, .font-cyber {
    font-family: var(--font-cyber);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Glassmorphism Utility */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-base);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-flow .glass-card {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-color: rgba(0,0,0,0.05);
}

.glass-card:hover {
    border-color: var(--accent-primary);
}

/* Neon Text Utilities */
.text-neon-cyan {
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-primary);
}
.text-neon-purple {
    color: var(--accent-secondary);
    text-shadow: 0 0 10px var(--accent-secondary);
}

/* UI Tokens */
.btn-cyber {
    font-family: var(--font-cyber);
    text-transform: uppercase;
    letter-spacing: 0.15em; font-size: 0.7rem;
    padding: 0.75rem 1.5rem; border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-base);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 0.5rem;
}

.btn-cyber:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-neon-cyan {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 243, 255, 0.05);
}

.btn-neon-cyan:hover {
    background: var(--accent-primary) !important;
    color: var(--bg-dark) !important;
    box-shadow: 0 0 20px var(--accent-primary);
}

/* Credential Component */
.credential-card {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 2px solid var(--accent-secondary);
    border-radius: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.credential-photo {
    height: 380px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.credential-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.credential-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 100%);
}

.qr-code {
    width: 60px; height: 60px;
    background: #fff;
    padding: 4px; border-radius: 4px;
}
.qr-code img {
    width: 100% !important; height: 100% !important;
}

/* HUD & Effects */
.scanline {
    width: 100%; height: 100px; z-index: 9999;
    background: linear-gradient(0deg, transparent 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
    opacity: var(--scanline-opacity);
    position: fixed; bottom: 100%; pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { bottom: 100%; }
    100% { bottom: -100px; }
}

/* Grid overlay for Cyber theme */
body::before {
    content: " ";
    display: block; position: fixed; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9998; background-size: 100% 2px, 3px 100%;
    pointer-events: none; opacity: var(--grid-opacity);
}

/* HUD Panel */
.hud-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-base);
    box-shadow: inset 0 0 20px rgba(0, 243, 255, 0.05);
    position: relative; overflow: hidden; border-radius: var(--radius-lg);
}

.hud-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
    transition: width 1s ease;
}

/* UI Tokens */
.btn-cyber {
    font-family: var(--font-cyber);
    text-transform: uppercase;
    letter-spacing: 0.15em; font-size: 0.7rem;
    padding: 0.75rem 1.5rem; border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-base);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.btn-neon-cyan {
    border-color: var(--accent-primary);
    background: hsla(var(--clr-cyan, 184 100% 50%), 0.05);
    color: var(--accent-primary);
}

.btn-neon-cyan:hover {
    background: var(--accent-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--accent-primary);
}

.cyber-input, .input-cyber {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-base) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1rem !important;
    color: var(--text-primary) !important;
    font-family: var(--font-main) !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    width: 100% !important;
}

.cyber-input:focus, .input-cyber:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 15px var(--accent-primary) !important;
}

/* Tables */
.cyber-table-container {
    overflow: hidden; border-radius: 1rem;
    border: 1px solid var(--border-base);
    background: var(--bg-card);
}

.cyber-table th {
    padding: 0.75rem 1rem; font-size: 0.65rem;
    font-family: var(--font-cyber);
    text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-base);
}

.cyber-table td {
    padding: 1rem; font-size: 0.875rem;
    border-bottom: 1px solid var(--border-base);
}

.cyber-table tr:hover td {
    background: rgba(var(--clr-cyan, 0, 243, 255), 0.03);
}
