/* ══════════════════════════════════════════════════════════════════
   QUIZ MODULE — Radim Branding v1.1
   Barvy: teal #5BA8A0, coral #F07D7E, bg #f8fafa
   Pro seniory: velké fonty, jasné barvy, dostatečný padding
   ══════════════════════════════════════════════════════════════════ */

/* ─── GLOBAL QUIZ TEXT COLOR FIX ─── */
#module-quiz {
    color: #2d3748 !important;
    background: #f8fafa !important;
}

#module-quiz h2,
#module-quiz h3,
#module-quiz h4,
#module-quiz p,
#module-quiz span,
#module-quiz label,
#module-quiz div {
    color: inherit;
}

#module-quiz .quiz-menu,
#module-quiz .quiz-categories,
#module-quiz .quiz-custom,
#module-quiz #quizDisplay,
#module-quiz #quizContent {
    color: #2d3748 !important;
}

#module-quiz .info-card {
    background: #ffffff !important;
    color: #2d3748 !important;
    border: 1px solid rgba(91, 168, 160, 0.15) !important;
    border-radius: 14px !important;
}

#module-quiz .info-card .info-value,
#module-quiz .info-card .info-label,
#module-quiz .info-card .info-icon {
    color: #2d3748 !important;
}

#module-quiz .info-card .info-label {
    color: #718096 !important;
}

/* ─── QUIZ MENU ─── */
.quiz-menu {
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
    color: #2d3748;
}

.quiz-menu-header {
    text-align: center;
    margin-bottom: 24px;
}

.quiz-menu-header h2 {
    font-size: 1.6rem;
    color: #2d3748;
    margin-bottom: 8px;
}

/* ─── DENNÍ KVÍZ KARTA ─── */
.daily-quiz-card {
    background: linear-gradient(135deg, #5BA8A0 0%, #4A9690 100%);
    color: white;
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(91, 168, 160, 0.3);
}

.daily-quiz-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 168, 160, 0.4);
}

.daily-quiz-card.completed {
    background: linear-gradient(135deg, #a0aec0, #718096);
    cursor: default;
    box-shadow: none;
}

.daily-quiz-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.daily-quiz-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.daily-quiz-info p {
    font-size: 0.85rem;
    opacity: 0.85;
}

.daily-quiz-arrow {
    margin-left: auto;
    font-size: 1.5rem;
    opacity: 0.7;
}

.daily-bonus {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ─── KATEGORIE GRID ─── */
.quiz-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.quiz-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px;
    background: #ffffff;
    color: #2d3748;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.quiz-category-card:hover {
    border-color: #5BA8A0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 168, 160, 0.15);
}

.quiz-category-card:active {
    transform: scale(0.97);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.category-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3748;
}

/* ─── VLASTNÍ KVÍZ ─── */
.custom-quiz-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.custom-quiz-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.custom-quiz-input:focus {
    outline: none;
    border-color: #5BA8A0;
}

/* ─── OBTÍŽNOST ─── */
.difficulty-selector {
    text-align: center;
    padding: 24px;
}

.difficulty-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.difficulty-card {
    padding: 20px 24px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-width: 120px;
    background: white;
}

.difficulty-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.difficulty-card.easy {
    border-color: #c6f6d5;
}
.difficulty-card.easy:hover {
    background: #f0fff4;
    border-color: #48bb78;
}

.difficulty-card.medium {
    border-color: #fefcbf;
}
.difficulty-card.medium:hover {
    background: #fffff0;
    border-color: #ecc94b;
}

.difficulty-card.hard {
    border-color: #fed7d7;
}
.difficulty-card.hard:hover {
    background: #fff5f5;
    border-color: #fc8181;
}

.difficulty-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.difficulty-name {
    font-weight: 700;
    font-size: 1rem;
    color: #2d3748;
}

.difficulty-desc {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 4px;
}

/* ─── AKTIVNÍ KVÍZ ─── */
.quiz-active-container {
    padding: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.quiz-header h2 {
    font-size: 1.2rem;
    color: #2d3748;
}

.quiz-difficulty-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.quiz-difficulty-badge.easy { background: #c6f6d5; color: #22543d; }
.quiz-difficulty-badge.medium { background: #fefcbf; color: #744210; }
.quiz-difficulty-badge.hard { background: #fed7d7; color: #742a2a; }

/* ─── PROGRESS BAR ─── */
.quiz-progress {
    margin-bottom: 16px;
}

.quiz-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.quiz-progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #5BA8A0, #48bb78);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #718096;
}

/* ─── OTÁZKA ─── */
.quiz-question {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-left: 4px solid #5BA8A0;
}

.quiz-question h3 {
    font-size: 1.15rem;
    color: #2d3748;
    line-height: 1.5;
}

/* ─── ODPOVĚDI ─── */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.05rem;
    color: #2d3748;
    text-align: left;
    width: 100%;
}

.quiz-option:hover {
    border-color: #5BA8A0;
    background: #f0fdfa;
}

.quiz-option.selected {
    border-color: #5BA8A0;
    background: rgba(91, 168, 160, 0.1);
    font-weight: 600;
}

.quiz-option.correct {
    border-color: #48bb78 !important;
    background: #f0fff4 !important;
    color: #22543d !important;
    font-weight: 700;
}

.quiz-option.incorrect {
    border-color: #fc8181 !important;
    background: #fff5f5 !important;
    color: #742a2a !important;
}

.quiz-option:disabled {
    cursor: default;
    opacity: 0.8;
}

/* ─── FEEDBACK ─── */
.quiz-feedback {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.quiz-feedback.correct {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #22543d;
}

.quiz-feedback.incorrect {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #742a2a;
}

.quiz-feedback.hidden {
    display: none;
}

/* ─── TLAČÍTKA ─── */
.quiz-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.quiz-actions .primary,
#submitAnswerBtn {
    background: linear-gradient(135deg, #5BA8A0, #4A9690);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-actions .primary:hover,
#submitAnswerBtn:hover {
    box-shadow: 0 4px 12px rgba(91, 168, 160, 0.3);
    transform: translateY(-1px);
}

#submitAnswerBtn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.quiz-actions .secondary,
.quiz-actions .ghost {
    background: white;
    color: #5BA8A0;
    border: 2px solid #5BA8A0;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-actions .secondary:hover,
.quiz-actions .ghost:hover {
    background: #f0fdfa;
}

/* ─── VÝSLEDKY ─── */
.quiz-results {
    text-align: center;
    padding: 24px;
}

.results-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
}

.results-score {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.results-stats {
    color: #718096;
    margin-bottom: 20px;
}

.results-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── STATISTIKY ─── */
.quiz-stats-view {
    padding: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-label {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 2px;
}

.streak-badge {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

/* ─── HISTORIE ─── */
.stats-history {
    margin-top: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.history-topic {
    font-weight: 600;
    color: #2d3748;
}

.history-date {
    font-size: 0.8rem;
    color: #a0aec0;
}

.history-score {
    font-weight: 700;
    color: #5BA8A0;
}

/* ─── CONTROLS ─── */
.quiz-controls {
    display: flex;
    gap: 6px;
}

.control-btn {
    background: rgba(91, 168, 160, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.control-btn:hover {
    background: rgba(91, 168, 160, 0.2);
}

/* ─── MOBILE ─── */
@media (max-width: 1024px) {
    .quiz-menu { padding: 10px; }
    .quiz-active-container { padding: 10px; }
    .quiz-category-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .quiz-category-card { padding: 12px 8px; }
    .category-icon { font-size: 1.5rem; }
    .category-name { font-size: 0.8rem; }
    .difficulty-options { flex-direction: column; align-items: center; }
    .difficulty-card { width: 100%; max-width: 250px; }
    .quiz-question { padding: 14px; }
    .quiz-question h3 { font-size: 1rem; }
    .quiz-option { padding: 12px 14px; font-size: 1rem; }
    .quiz-actions { flex-direction: column; }
    .quiz-actions .primary, .quiz-actions .secondary, #submitAnswerBtn { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .daily-quiz-card { padding: 14px 16px; }
    .daily-quiz-icon { font-size: 2rem; }
}
