/* --- SDÍLENÉ PROMĚNNÉ --- */
:root {
    --bg-dark: #020617;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    
    --status-ok: #10b981;
    --status-warn: #f59e0b;
    --status-crit: #ef4444;

    --border: rgba(148, 163, 184, 0.15);
    --card-glass: rgba(15, 23, 42, 0.6);
    --font-main: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

/* --- RESET & ZÁKLAD --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* --- MATRIX CANVAS --- */
#matrix {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; opacity: 0.35; pointer-events: none;
}

/* --- HLAVNÍ LAYOUT --- */
#main-ui {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2vh 4vw;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
}

/* --- HEADER --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 1vh;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
    backdrop-filter: blur(2px);
    flex-shrink: 0;
}

h1 {
    font-size: 2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    background: linear-gradient(90deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
    line-height: 1;
}

/* Varianta pro Error stránku (červený nadpis) */
.error-mode h1 {
    background: linear-gradient(90deg, var(--text-primary), var(--status-crit));
    -webkit-background-clip: text;
    background-clip: text;
}

.subtitle {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-top: 5px;
}
.error-mode .subtitle { color: var(--status-crit); }

/* --- JAZYKOVÝ PŘEPÍNAČ --- */
.lang-switch { display: flex; gap: 10px; }

.lang-btn {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    transition: all 0.2s;
    border-radius: 4px;
}

.lang-btn.active, .lang-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.error-mode .lang-btn.active, .error-mode .lang-btn:hover {
    border-color: var(--status-crit);
    color: var(--status-crit);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

/* --- GRID SYSTEM --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    margin: auto 0;
    align-content: center;
}

/* Single grid pro 404 stránku (vycentrovaná karta) */
.dashboard-grid.grid-single {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none; 
}

/* --- KARTY (GLASS PANELS) --- */
.glass-panel {
    background: var(--card-glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3.5vh 2vw;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.2vh;
    height: auto;
    min-height: 45vh;
}

.panel-header {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5vh;
    margin-bottom: 1.5vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.panel-icon { font-size: 1.3rem; }

/* --- BAREVNÉ VARIANTY HLAVIČEK (LANDING + GATEKEEPER) --- */
.panel-nav .panel-header { color: var(--accent-cyan); }
.panel-info .panel-header { color: var(--accent-blue); }
.panel-gate .panel-header { color: var(--accent-purple); }
.panel-data .panel-header { color: var(--status-ok); } /* Gatekeeper */
.panel-sec .panel-header { color: var(--accent-cyan); } /* Gatekeeper */
.panel-ai .panel-header { color: var(--accent-pink); } /* Gatekeeper */
.panel-family .panel-header { color: var(--accent-cyan); }
.panel-game .panel-header { color: var(--accent-cyan); }
.panel-app .panel-header { color: var(--accent-purple); }
.panel-empty .panel-header { color: var(--text-muted); }
.error-mode .panel-header { color: var(--status-crit); } /* 404 */

/* --- PRVKY LANDING PAGE (ODKAZY) --- */
.link-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5vh 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    width: 100%;
    margin: 0; 
}
/* Zarovnání odkazů dolů v kartách */
.panel-game .link-row, .panel-app .link-row { margin-top: auto; }

/* Hover efekty pro odkazy */
.link-row:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--accent-cyan);
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}
.panel-app .link-row:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

.link-label { font-family: var(--font-main); font-weight: 600; color: var(--text-primary); letter-spacing: 1px; text-transform: uppercase; font-size: 1rem; }
.link-arrow { font-family: var(--font-mono); color: var(--accent-cyan); opacity: 0.5; transition: opacity 0.2s; font-size: 0.9rem; }
.panel-app .link-arrow { color: var(--accent-purple); }
.link-row:hover .link-arrow { opacity: 1; }

/* --- TEXTY A INFO (LANDING) --- */
.panel-text { 
    font-family: var(--font-mono); 
    color: var(--text-secondary); 
    font-size: 0.95rem; 
    line-height: 1.6; 
    margin-top: 1vh; 
    margin-bottom: 1vh; 
}
.panel-text-center { 
    display: flex; flex-direction: column; justify-content: center; 
    align-items: center; text-align: center; gap: 0; 
    font-family: var(--font-mono); font-size: 1rem; color: var(--text-muted); 
}
.info-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-family: var(--font-mono); 
    font-size: 0.95rem; 
    color: var(--text-secondary); 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    padding: 1vh 0; 
    width: 100%; 
}
.info-row:last-child { border-bottom: none; }
.info-val { color: var(--text-primary); }

/* --- PRVKY GATEKEEPER (GRAFY) --- */
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    height: 20px;
}
.stat-label { width: 80px; }
.stat-bar-container {
    flex: 1; height: 4px; background: rgba(255,255,255,0.05);
    margin: 0 10px; border-radius: 2px; overflow: hidden; position: relative;
}
.stat-bar {
    height: 100%; width: 0%; background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
}
.bar-disk { background: var(--accent-purple); box-shadow: 0 0 10px var(--accent-purple); }
.bar-ai { background: var(--accent-pink); box-shadow: 0 0 10px var(--accent-pink); }
.stat-value { width: 40px; text-align: right; color: var(--text-primary); }

/* --- 404 ERROR SPECIFIKA (GLITCH A LAYOUT) --- */
.error-center-block { 
    flex-grow: 1; display: flex; flex-direction: column; 
    justify-content: center; align-items: center; 
    width: 100%; min-height: auto; padding: 0;
}
.error-code-container { 
    font-size: 6rem; font-weight: 800; line-height: 1; height: 6rem; 
    font-family: var(--font-mono); display: flex; justify-content: center; 
    margin-bottom: 1vh; overflow: hidden; 
}
.matrix-digit, .matrix-char { 
    display: inline-block; text-align: center; vertical-align: middle; 
    opacity: 1; color: var(--status-crit); 
    transition: color 0.05s, opacity 0.05s; 
}
.matrix-digit { width: 70px; }
.matrix-char { width: 15px; }
.is-glitching { 
    color: #ffffff !important; 
    text-shadow: 0 0 15px #ffffff, -2px 0 var(--accent-blue); 
    transform: scale(1.03) skewX(-2deg); 
}
.is-stable { color: var(--status-crit); }
.error-text-glitch { 
    display: flex; flex-direction: row; flex-wrap: wrap; 
    justify-content: center; align-items: center; text-align: center; 
    gap: 0; font-family: var(--font-mono); font-size: 1.3rem; 
    text-transform: uppercase; letter-spacing: 2px; font-weight: 600; 
    color: var(--status-crit); line-height: 2rem; 
}
.sec-status-footer { 
    border-top: 1px dashed var(--status-crit); padding-top: 10px; 
    font-size: 0.8rem; color: var(--status-crit); text-align: right; 
    opacity: 0.7; font-family: var(--font-mono); width: 100%; 
}

/* --- TLAČÍTKA (ACTION PANEL) --- */
.action-panel {
    grid-column: 1 / -1;
    display: flex; justify-content: center; gap: 20px;
    margin-top: 1.5vh; padding: 0;
}

.cyber-btn {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 1.2vh 20px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    width: 320px;
    display: flex; justify-content: center; align-items: center; text-align: center;
}
.cyber-btn:hover {
    background: var(--accent-cyan); color: #000;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* Varianty tlačítek */
.cyber-btn.btn-secondary {
    border-color: var(--border); color: var(--text-secondary); background: transparent;
}
.cyber-btn.btn-secondary:hover {
    border-color: var(--text-primary); color: var(--text-primary);
    background: rgba(255,255,255,0.05); box-shadow: none;
}
.cyber-btn.btn-purple {
    border-color: var(--accent-purple); color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
}
.cyber-btn.btn-purple:hover {
    background: var(--accent-purple); color: #fff;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}
.cyber-btn.btn-blue-alt {
    border-color: var(--accent-blue); color: var(--accent-blue);
}
.cyber-btn.btn-blue-alt:hover {
    background: var(--accent-blue); color: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}
.cyber-btn.btn-denied {
    border-color: var(--status-crit);
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-crit);
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
.cyber-btn.btn-denied:hover {
    background: var(--status-crit); color: #fff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* --- FOOTER --- */
footer {
    margin-top: 0; display: flex; justify-content: space-between; align-items: center;
    padding-top: 1vh; border-top: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted);
    flex-shrink: 0; padding-bottom: 1.5vh;
}
.status-indicator { display: flex; align-items: center; gap: 10px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); transition: all 0.3s; }

/* --- POMOCNÉ TŘÍDY --- */
.separator { height: 1px; background: var(--border); margin: 0.5vh 0; opacity: 0.3; }
.dashed-separator { flex-grow: 1; border: 1px dashed var(--border); opacity: 0.3; border-radius: 4px; margin-top: 10px; }
.icon-placeholder { font-size: 3rem; margin-bottom: 20px; opacity: 0.2; }
.text-ok { color: var(--status-ok); }
.text-muted { color: var(--text-muted); }
.text-italic { font-style: italic; }
.grayscale { filter: grayscale(1); }
.no-border { border: none; }

/* --- ANIMACE --- */
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- RESPONZIVITA --- */
@media (max-width: 900px) {
    body { overflow-y: auto; height: auto; }
    #main-ui { padding: 1rem; height: auto; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 15px; margin: 20px 0; }
    .action-panel { flex-direction: column; align-items: stretch; margin-top: 10px; }
    .cyber-btn { width: 100%; min-width: 0; padding: 15px; }
    h1 { font-size: 1.8rem; }
    .glass-panel { padding: 20px; gap: 12px; height: auto; min-height: 0; }
    
    /* Mobilní 404 */
    .error-code-container { font-size: 4rem; height: 4rem; line-height: 4rem; } 
    .matrix-digit { width: 50px; } 
    .matrix-char { width: 16px; }
    .error-text-glitch { font-size: 0.9rem; height: auto; line-height: 1.2; padding: 5px 0; }
}