/* =========================================
   1. POZADÍ A ZÁKLADNÍ NASTAVENÍ
   ========================================= */

body {
    background-color: #050505;
    /* Černá záloha, kdyby se nenačetl obrázek */
    color: #e2e8f0;
}

/* Vesmírné pozadí s animovaným gradientem */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    /* Fialová -> Tmavě modrá -> Černá */
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Hvězdy (statické tečky) */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: radial-gradient(white, rgba(255, 255, 255, .2) 2px, transparent 3px), radial-gradient(white, rgba(255, 255, 255, .15) 1px, transparent 2px);
    background-size: 550px 550px, 350px 350px;
    background-position: 0 0, 40px 60px;
    opacity: 0.4;
}

/* =========================================
   2. HLAVIČKA A NAVIGACE
   ========================================= */

.header-bar {
    background: rgba(20, 30, 48, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 50;
}

/* =========================================
   3. SKLENĚNÁ TLAČÍTKA (GLASSMORPHISM)
   ========================================= */

.glass-button {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* Hover efekt - Neonová záře */
.glass-button:hover {
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4), /* Zelená */
    0 0 30px rgba(0, 184, 255, 0.3); /* Modrá */
}

/* Velká tlačítka v menu */
.main-choice-btn {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.main-choice-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: #fff;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.3); /* Cyan glow */
}

/* Input pro API klíč */
.api-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* Zelená záře, když je klíč uložen */
.key-saved {
    border-color: #4ade80 !important; /* Green-400 */
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.6) !important;
    color: #4ade80 !important;
}

/* =========================================
   4. PANELY A TEXTAREA (S FIXEM PRO BÍLÁ POLE)
   ========================================= */

/* Obal panelu */
.glass-panel {
    background: transparent;
    border-radius: 1rem;
    padding: 1px;
    background-image: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Vnitřek panelu */
.glass-panel-inner {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(15px);
    border-radius: 1rem;
    height: 100%;
}

/* --- FIX: VYNUCENÍ TMAVÉHO POZADÍ PRO INPUTY --- */
input, 
textarea, 
select {
    background-color: #0f172a !important; /* Tmavě modrá/černá */
    background-image: none !important;    
    color: #ffffff !important;            /* Bílý text */
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.75rem !important;
    padding: 1rem !important;
}

/* Třídy pro sklo (pojistka) */
.glass-textarea, 
.glass-select, 
.api-input {
    background-color: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(10px);
    color: #fff !important;
}

/* Focus stav (když píšeš) */
input:focus, 
textarea:focus, 
select:focus {
    background-color: #000000 !important;
    border-color: #00ff88 !important; /* Neonová zelená */
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2) !important;
    outline: none !important;
    color: #ffffff !important;
}

/* Dropdown šipka */
.glass-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='cyan' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1em !important;
    padding-right: 2.5rem !important;
    cursor: pointer;
}

.glass-select option {
    background-color: #0f172a;
    color: white;
}

/* Placeholder (šedý text nápovědy) */
::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1;
}

/* =========================================
   5. TEXTOVÉ VÝSTUPY (MARKDOWN / PROSE)
   ========================================= */

#lab-result, 
#math-text-result, 
#arduino-wiring, 
#explainer-result, 
.prose, 
.prose p {
    color: #e2e8f0 !important; /* Jasně světle šedá */
    font-size: 0.95rem;
    line-height: 1.6;
}

.prose h1, .prose h2, .prose h3 {
    color: #fff;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose h1 { color: #60a5fa; }
.prose h2 { color: #38bdf8; }

.prose ul, .prose ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.prose strong {
    color: #4ade80;
}

.prose code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #f472b6;
}

/* =========================================
   6. OSTATNÍ
   ========================================= */

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Oprava highlight.js pozadí */
pre code.hljs {
    background: transparent !important;
    padding: 0 !important;
}

.hidden {
    display: none !important;
}
