/* =============================================
   kviz.css – Kviz 25 pitanja
   Povijest 6. razred
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 50%, #2d1b69 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ── HEADER ── */
header {
    text-align: center;
    padding: 30px 20px 20px;
    margin-bottom: 25px;
}

header .badge {
    display: inline-block;
    background: rgba(240,192,64,0.2);
    border: 1px solid #f0c040;
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 0.8rem;
    color: #f0c040;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

header h1 {
    font-size: 2rem;
    color: #f0c040;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.6);
    margin-bottom: 8px;
}

header p {
    font-size: 0.95rem;
    color: #b39ddb;
}

/* ── INSTRUCTIONS ── */
.instructions {
    background: rgba(179,157,219,0.1);
    border-left: 4px solid #b39ddb;
    border-radius: 0 10px 10px 0;
    padding: 14px 20px;
    margin-bottom: 25px;
    font-size: 0.93rem;
    color: #e0e0e0;
    line-height: 1.6;
}

.instructions strong {
    color: #b39ddb;
}

/* ── SCORE BAR ── */
.score-bar {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 18px 25px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    position: sticky;
    top: 10px;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.score-left h3 {
    color: #b39ddb;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.score-display {
    font-size: 2.2rem;
    font-weight: 900;
    color: #69f0ae;
    line-height: 1;
}

.score-display span {
    font-size: 0.95rem;
    font-weight: normal;
    color: #b39ddb;
}

.progress-wrap {
    flex: 1;
    min-width: 160px;
}

.progress-label {
    font-size: 0.78rem;
    color: #b39ddb;
    margin-bottom: 5px;
}

.progress-bar-outer {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #b39ddb, #7c4dff);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.reset-btn {
    background: linear-gradient(135deg, #f0c040, #e67e22);
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #1a1a2e;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(240,192,64,0.25);
    white-space: nowrap;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240,192,64,0.45);
}

/* ── TOPIC DIVIDER ── */
.topic-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 18px;
}

.topic-divider .topic-label {
    background: linear-gradient(135deg, rgba(179,157,219,0.25), rgba(124,77,255,0.2));
    border: 1px solid rgba(179,157,219,0.4);
    border-radius: 20px;
    padding: 5px 18px;
    font-size: 0.82rem;
    color: #ce93d8;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.topic-divider .divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(179,157,219,0.4), transparent);
}

/* ── QUIZ CARD ── */
.quiz-card {
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 18px;
    transition: border-color 0.3s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c4dff, #b39ddb, #f0c040);
    opacity: 0;
    transition: opacity 0.3s;
}

.quiz-card:hover::before {
    opacity: 1;
}

.quiz-card:hover:not(.answered) {
    border-color: rgba(179,157,219,0.4);
    transform: translateY(-1px);
}

.quiz-card.answered {
    transform: none !important;
}

/* ── CARD HEADER ── */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.q-number {
    background: linear-gradient(135deg, #7c4dff, #b39ddb);
    color: #fff;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    box-shadow: 0 3px 10px rgba(124,77,255,0.4);
}

.question-text {
    font-size: 0.97rem;
    color: #e8eaf6;
    line-height: 1.55;
    flex: 1;
    padding-top: 2px;
}

/* ── OPTIONS ── */
.options {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-left: 50px;
}

.option-btn {
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.13);
    border-radius: 10px;
    padding: 11px 15px;
    color: #e0e0e0;
    font-size: 0.87rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.22s;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.35;
}

.opt-letter {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: bold;
    color: rgba(255,255,255,0.5);
    transition: all 0.22s;
    flex-shrink: 0;
}

.option-btn:hover:not(:disabled) {
    background: rgba(179,157,219,0.18);
    border-color: #b39ddb;
    color: #fff;
    transform: translateX(5px);
}

.option-btn:hover:not(:disabled) .opt-letter {
    border-color: #b39ddb;
    color: #b39ddb;
}

/* CORRECT */
.option-btn.correct {
    background: rgba(76,175,80,0.28) !important;
    border-color: #4CAF50 !important;
    color: #b9f6ca !important;
    font-weight: bold;
    transform: none !important;
}

.option-btn.correct .opt-letter {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
    font-size: 0.85rem;
}

/* WRONG */
.option-btn.wrong {
    background: rgba(244,67,54,0.22) !important;
    border-color: #f44336 !important;
    color: #ffcdd2 !important;
    transform: none !important;
}

.option-btn.wrong .opt-letter {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
    font-size: 0.85rem;
}

/* SHOW CORRECT AFTER WRONG */
.option-btn.show-correct {
    background: rgba(76,175,80,0.12) !important;
    border-color: rgba(76,175,80,0.45) !important;
    color: #c8f7c5 !important;
    transform: none !important;
}

.option-btn.show-correct .opt-letter {
    border-color: #4CAF50;
    color: #4CAF50;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.88;
}

/* ── FEEDBACK ── */
.feedback {
    margin-top: 12px;
    margin-left: 50px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.83rem;
    line-height: 1.5;
    display: none;
    animation: fadeIn 0.3s ease;
}

.feedback.show {
    display: block;
}

.feedback.correct-fb {
    background: rgba(76,175,80,0.13);
    border-left: 3px solid #4CAF50;
    color: #c8f7c5;
}

.feedback.wrong-fb {
    background: rgba(244,67,54,0.1);
    border-left: 3px solid #f44336;
    color: #ffcdd2;
}

/* ── FINAL RESULT ── */
.final-result {
    display: none;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(240,192,64,0.45);
    border-radius: 18px;
    padding: 30px;
    text-align: center;
    margin: 30px 0;
    animation: fadeIn 0.5s ease;
}

.final-result.show {
    display: block;
}

.result-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
}

.final-result h2 {
    color: #f0c040;
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.final-result .result-score {
    font-size: 3rem;
    font-weight: 900;
    color: #69f0ae;
    margin-bottom: 10px;
}

.final-result p {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 600px;
    margin: 0 auto;
}

.stars {
    font-size: 2rem;
    margin: 10px 0;
    letter-spacing: 4px;
}

/* ── NAV LINKS ── */
.nav-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.nav-links a {
    display: inline-block;
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(179,157,219,0.3);
    border-radius: 10px;
    padding: 10px 20px;
    color: #b39ddb;
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.3s;
    margin: 5px;
}

.nav-links a:hover {
    background: rgba(179,157,219,0.15);
    color: #fff;
    border-color: #b39ddb;
    transform: translateY(-2px);
}

.nav-links a.active {
    background: rgba(240,192,64,0.2);
    border-color: #f0c040;
    color: #f0c040;
    font-weight: bold;
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    header h1 { font-size: 1.4rem; }
    .score-bar { flex-direction: column; text-align: center; }
    .options { padding-left: 0; }
    .feedback { margin-left: 0; }
    .card-header { flex-direction: column; gap: 8px; }
    .q-number { width: 30px; height: 30px; min-width: 30px; }
}
