:root {
    --primary: #2e7d32;      
    --primary-light: #66bb6a;
    --accent: #a5d6a7;        
    --bg-color: #f1f8e9;      
    --card-bg: #ffffff;
    --text-main: #333;
    --border-color: #c8e6c9;
    
    --answer-bg: #e8f5e9;     
    --highlight-color: #fff3e0; 
    --strong-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.6;
}

/* 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;
}

.controls-wrapper.scrolled {
    padding: 10px 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary);
    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 & Inputs */
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary);
}

/* Buttons */
.mode-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.mode-btn.active, .mode-btn:hover {
    background: var(--primary);
    color: white;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary-light);
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
    background: var(--primary);
}

/* Styl pro tlačítko tisku */
.btn-print {
    background: #455a64; /* Odlišná barva pro tisk */
}
.btn-print:hover { background: #37474f; }

.btn-reset {
    background: #757575;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 40px;
}

/* Content & Cards */
.container {
    max-width: 900px;
    margin: 30px 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);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card.reading-active {
    border-left-color: #ff9800;
    background-color: var(--highlight-color);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.4);
}

.question {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.answer {
    font-size: 1rem;
    color: #455a64;
    padding-top: 10px;
    border-top: 1px solid #eee;
    line-height: 1.6;
}

.answer strong {
    color: var(--strong-text);
    font-weight: 700;
    background-color: rgba(46, 125, 50, 0.1); 
    padding: 0 3px;
    border-radius: 4px;
}

.answer ul, .answer ol {
    padding-left: 20px;
    margin: 10px 0;
}
.answer li {
    margin-bottom: 5px;
}

.test-mode .answer {
    filter: blur(8px);
    opacity: 0.5;
    user-select: none;
    transition: all 0.3s;
}

.test-mode .card.revealed .answer {
    filter: none;
    opacity: 1;
    user-select: auto;
}

/* Utilities */
.mobile-only { display: none; }
#status-bar { font-size: 0.9rem; color: #666; margin-top: 10px; }

/* --- MOBILE SPECIFIC STYLES --- */
@media (max-width: 600px) {
    .desktop-only { display: none; }
    .top-row { display: none; } 
    
    .mobile-only { display: block; }
    select.mobile-only { display: none; }
    
    span.mobile-logo { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center;
        font-size: 1.5rem; 
        margin-right: 5px;
    }
    
    .btn-play, .btn-pause { display: none !important; }
    .btn-reset .btn-text { display: none; }

    .controls-wrapper { padding: 10px; }

    .toolbar {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 8px;
        margin-top: 0;
        flex-wrap: nowrap;
    }

    .search-input {
        flex: 1; 
        width: auto;
        margin: 0;
    }

    .btn-icon, .btn-reset {
        width: 40px;
        height: 40px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    #audio-controls {
        display: flex;
        align-items: center;
    }
}

/* =========================================
   STYLY PRO TISK (TAHÁK)
   ========================================= */
@media print {
    /* Skrytí uživatelského rozhraní */
    .controls-wrapper, 
    .container, 
    .mode-switch,
    #status-bar,
    .btn-reset,
    .btn-icon {
        display: none !important;
    }

    /* Zobrazení a formátování tiskové oblasti */
    #printable-area {
        display: block !important;
        width: 100%;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        font-size: 10px; /* Zmenšené písmo pro maximální hustotu informací */
        line-height: 1.3;
        color: #000;
        
        /* Rozložení do 3 sloupců */
        column-count: 3;
        column-gap: 15px;
        column-rule: 1px solid #ddd;
    }

    .print-item {
        break-inside: avoid; /* Zabrání rozdělení otázky mezi sloupce */
        page-break-inside: avoid;
        margin-bottom: 10px;
        padding-bottom: 5px;
        border-bottom: 1px dotted #ccc;
    }

    .print-question {
        font-weight: bold;
        color: #2e7d32; /* Zelená barva pro otázky */
        display: block;
        margin-bottom: 2px;
        font-size: 11px;
    }

    .print-answer {
        color: #000;
        display: block;
    }
    
    /* Úprava seznamů a odstavců pro tisk */
    .print-answer ul, .print-answer ol {
        margin: 2px 0;
        padding-left: 15px;
    }
    .print-answer li { margin-bottom: 0; }
    .print-answer p { margin: 2px 0; }

    /* Zvýraznění (strong) v odpovědích */
    .print-answer strong {
        color: #1b5e20 !important;
        background-color: transparent !important;
    }

    /* Vizuální oddělení odpovědi */
    .print-highlight {
        display: block;
        padding-left: 5px;
        border-left: 2px solid #a5d6a7;
    }

    @page {
        margin: 1cm;
        size: A4 portrait;
    }
}