:root {
    /* Hlavní barvy */
    --primary: #e67e22;      
    --primary-light: #ffb74d; 
    --bg-color: #fff3e0;      
    --card-bg: #ffffff;
    --text-main: #333;

    /* Barvy pro správnou odpověď (zelená) */
    --correct-bg: #e8f5e9;
    --correct-border: #2e7d32;
    --correct-text: #1b5e20;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding-bottom: 80px;
    line-height: 1.5;
}

/* --- Sticky Header --- */
.controls-wrapper {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    padding: 15px 20px;
    z-index: 1000;
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.top-row {
    margin-bottom: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

h1 { margin: 0; color: var(--primary); font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }

.logo-link {
    text-decoration: none; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    transition: transform 0.2s ease;
}
.logo-link:hover { transform: scale(1.1); }

.toolbar { display: flex; gap: 10px; align-items: center; width: 100%; transition: all 0.3s; }
.control-group { display: flex; gap: 5px; flex-shrink: 0; }

/* Tlačítka */
.btn-icon { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 0; 
    border-radius: 50%; 
    cursor: pointer; 
    width: 38px; 
    height: 38px; 
    font-size: 14px; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0; 
}
.btn-icon:hover { background: #d35400; }

.btn-print { background: #34495e; } /* Specifická barva pro tisk */
.btn-print:hover { background: #2c3e50; }

.btn-reset { background: #e67e22; margin-left: auto; }
.btn-reset:hover { background: #d35400; }

.search-input { 
    flex-grow: 1; 
    padding: 8px 15px; 
    border: 1px solid var(--primary-light); 
    border-radius: 20px; 
    outline: none; 
    min-width: 0; 
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 5px rgba(230, 126, 34, 0.3); }

#status-bar { margin-top: 5px; font-size: 0.85rem; color: #666; }

/* Responsivita Headeru */
@media (max-width: 600px) {
    .btn-play, .btn-pause { display: none; }
    h1 { font-size: 1.3rem; }
    .top-row { margin-bottom: 10px; }

    .controls-wrapper.scrolled { padding: 8px 15px; display: flex; align-items: center; gap: 10px; }
    .controls-wrapper.scrolled .top-row { margin-bottom: 0; width: auto; flex-shrink: 0; }
    .controls-wrapper.scrolled .site-title { display: none; }
    .controls-wrapper.scrolled .toolbar { margin-top: 0; width: auto; flex-grow: 1; justify-content: flex-end; }
    .controls-wrapper.scrolled .search-input { width: 100%; font-size: 0.9rem; padding: 6px 12px; }
    .controls-wrapper.scrolled #status-bar { display: none; }
}

/* --- Karty a obsah --- */
.container { max-width: 900px; margin: 20px auto; padding: 0 15px; }

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 6px solid var(--primary-light);
    transition: transform 0.2s;
    cursor: pointer; 
}
.card:hover { transform: translateY(-2px); }
.card.reading-active { border-left-color: #d35400; background-color: #fff8e1; }

.category-tag {
    display: inline-block;
    background: #f0f0f0;
    color: #888;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.question-text { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; color: #d35400; }
.question-img { max-width: 100%; height: auto; border-radius: 8px; margin: 10px 0; border: 1px solid #ddd; display: block; }

/* Otevřená odpověď */
.study-answer-text {
    background: var(--correct-bg); 
    padding: 15px; 
    border-radius: 8px;
    border-left: 5px solid var(--correct-border);
    color: var(--correct-text);
    margin-top: 15px;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Uzavřená otázka (seznam možností) */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #555;
    transition: all 0.2s;
}

.option-item .opt-key {
    font-weight: bold;
    margin-right: 12px;
    color: var(--primary);
    min-width: 20px;
}

.option-item .opt-val { flex-grow: 1; }

/* Správná možnost */
.option-item.correct {
    background-color: var(--correct-bg);
    border-color: var(--correct-border);
    color: var(--correct-text);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(46, 125, 50, 0.1);
}

.option-item.correct .opt-key { color: var(--correct-text); }

.correct-badge {
    background: var(--correct-border);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
    text-transform: uppercase;
    font-weight: bold;
    white-space: nowrap;
}

/* --- STYLY PRO TISK (TAHÁK) --- */
@media print {
    /* Skryjeme UI aplikace */
    .controls-wrapper, .container, .btn-icon, #status-bar {
        display: none !important;
    }

    /* Zobrazíme tiskovou oblast */
    #printable-area {
        display: block !important;
        width: 100%;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        font-size: 10px; /* Malé písmo pro tahák */
        line-height: 1.3;
        color: #000;
        
        /* 3 sloupce */
        column-count: 3;
        column-gap: 15px;
        column-rule: 1px solid #ddd;
    }

    .print-category-header {
        break-after: avoid;
        margin: 10px 0 5px 0;
        text-transform: uppercase;
        color: #e67e22;
        border-bottom: 2px solid #e67e22;
        font-size: 11px;
    }

    .print-item {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px dotted #ccc;
    }

    .print-question {
        font-weight: bold;
        color: #333;
        display: block;
        margin-bottom: 2px;
    }

    .print-answer {
        color: #000;
        display: block;
    }

    .print-highlight {
        font-weight: 800;
        color: #1b5e20 !important;
        background-color: #e8f5e9 !important;
        padding: 1px 4px;
        border-radius: 3px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 1cm;
        size: A4 portrait;
    }
}