/* =========================================
   forms.css - Styly pro formuláře
   ========================================= */

/* --- 1. GLOBÁLNÍ PROMĚNNÉ --- */
:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --muted-color: #94a3b8;
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --radius: 8px;
    --transition: 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding-bottom: 60px;
}

main {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
}

/* --- 2. NADPIS --- */
h1 {
    font-weight: 300;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

/* --- 3. KONTEJNER FORMULÁŘE --- */
form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* --- 4. INPUTY A LABELY --- */
label {
    display: block;
    margin-bottom: 8px;
    margin-top: 20px;
    color: var(--muted-color);
    font-weight: 500;
    font-size: 0.9rem;
}
label:first-of-type { margin-top: 0; }

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #334155;
    border-radius: var(--radius);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

textarea { resize: vertical; min-height: 120px; }

/* --- 5. HLAVNÍ TLAČÍTKA (Submit) --- */
input[type="submit"],
button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
    transition: all var(--transition);
}

input[type="submit"]:hover,
button[type="submit"]:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.6);
}

form a {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: var(--muted-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
form a:hover { color: #fff; text-decoration: underline; }

/* --- 6. FIELDSET --- */
fieldset {
    border: 1px solid #334155;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.2);
}
legend { color: var(--primary-color); padding: 0 10px; font-weight: bold; }

/* --- 7. FILE UPLOAD --- */
#file_input_container {
    margin-top: 15px;
    padding: 20px;
    border: 2px dashed #334155;
    border-radius: var(--radius);
    text-align: center;
    transition: border-color var(--transition);
}
#file_input_container:hover { border-color: var(--primary-color); }

.media-preview {
    margin-top: 15px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: var(--radius);
}
.media-preview p { margin-top: 0; color: var(--muted-color); font-size: 0.9rem; }
.media-preview img, .media-preview video {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    object-fit: contain;
    border: 1px solid #334155;
    border-radius: 4px;
}

/* --- 8. CHYBOVÉ HLÁŠKY --- */
.error-msg, p.error {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.25);
    border: 1px solid var(--danger-color);
    padding: 12px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
}
.hidden { display: none !important; }

/* --- 9. DYNAMICKÉ PRVKY SCÉNÁŘE (Selecty a tlačítka) --- */

/* Řádek s výběrem postavy a mazacím tlačítkem */
.char-row {
    display: flex;
    align-items: center;
    gap: 10px; /* Mezera mezi selectem a tlačítkem */
    margin-bottom: 12px; /* Odstup řádků */
}

/* Select v řádku se roztáhne */
.char-row select {
    flex-grow: 1; /* Zabere veškeré volné místo */
    margin-bottom: 0; /* Zrušíme globální margin, pokud by nějaký byl */
}

/* Tlačítko pro odebrání postavy (X) */
.remove-char-btn {
    flex-shrink: 0; /* Nezmenší se */
    width: 45px;   /* Stejná výška jako inputy cca */
    height: 45px;
    
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    border-radius: var(--radius);
    
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-char-btn:hover {
    background-color: var(--danger-color);
    color: white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* Tlačítko "Přidat další postavu" (Sekundární akce) */
#add_character_btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 30px;
    
    background-color: transparent;
    border: 1px dashed #334155;
    color: var(--primary-color);
    
    padding: 12px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#add_character_btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(14, 165, 233, 0.05);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.1);
}

/* Skrytá šablona pro JS */
.template {
    display: none !important;
}