:root {
    /* Hlavní barva: Fialová (#9b59b6) - Právo v ŽP */
    --primary: #9b59b6;      
    --primary-light: #af7ac5; 
    --accent: #d2b4de;        
    --bg-color: #f4ecf7;      
    --card-bg: #ffffff;
    --text-main: #333;
    --border-color: #e8daef;
    
    --answer-bg: #f5eef8;     
    --highlight-color: #fff3e0; /* Žlutá pro aktivní čtení */
    --strong-text: #6c3483;     
}

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;
}

/* Odkaz na domovskou stránku (Logo desktop) */
.home-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;   
    align-items: center;
    transition: transform 0.2s;
}

.home-link:hover {
    transform: scale(1.1);
    cursor: pointer;
}

/* --- 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);
}

/* --- Tlačítka (Buttons) --- */

/* Základní styl pro tlačítka módů */
.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;
    
    /* Odstranění podtržení a flex pro ikony */
    text-decoration: none;      
    display: inline-flex;       
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

/* Stavy tlačítek */
.mode-btn:visited, .mode-btn:active, .mode-btn:focus {
    text-decoration: none;
    color: var(--primary);
}

.mode-btn.active, .mode-btn:hover {
    background: var(--primary);
    color: white !important;
}

/* Kulatá tlačítka (ikony v toolbaru) */
.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);
}

/* Reset tlačítko */
.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);
}

/* Štítek sady (pokud by byl potřeba) */
.sada-tag {
    display: inline-block;
    background-color: var(--accent);
    color: var(--strong-text);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.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(155, 89, 182, 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 (Rozmazání odpovědí) */
.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 (< 600px) --- */
@media (max-width: 600px) {
    /* Skrýt desktop prvky */
    .desktop-only { display: none; }
    .top-row { display: none; } 
    
    /* Zobrazit mobile-only prvky */
    .mobile-only { display: block; }
    
    select.mobile-only { display: none; } 
    
    /* Styl pro odkaz na logo v mobilu (OPRAVENO) */
    a.mobile-home-link {
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: 5px;
        cursor: pointer;
    }

    span.mobile-logo { 
        font-size: 1.5rem; 
    }
    
    .btn-play, .btn-pause { display: none !important; }
    .btn-reset .btn-text { display: none; }

    .controls-wrapper { padding: 10px; }

    /* Úprava toolbaru pro mobil */
    .toolbar {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 6px;
        margin-top: 0;
        flex-wrap: nowrap;
    }

    .search-input {
        flex: 1; 
        width: auto;
        margin: 0;
        min-width: 0;
    }

    /* Tlačítka v toolbaru */
    .btn-icon, .btn-reset {
        width: 40px;
        height: 40px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* --- MOBILNÍ TLAČÍTKA (T = Test, S = Studium) --- */
    /* Univerzální styl pro obě varianty */
    a.mobile-test-btn, 
    a.mobile-study-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: var(--primary);
        color: white;
        font-weight: 800;
        font-size: 1.2rem;
        
        margin-right: 2px;
        flex-shrink: 0;
        
        transition: transform 0.2s, background-color 0.2s;
    }

    a.mobile-test-btn:hover, a.mobile-test-btn:active,
    a.mobile-study-btn:hover, a.mobile-study-btn:active {
        transform: scale(1.1);
        background-color: var(--strong-text);
        color: white;
    }
    
    #audio-controls {
        display: flex;
        align-items: center;
    }
}