/* =============================================
   lenta2.css – Lenta vremena Kviz 2
   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, #0d1b2a 0%, #1b263b 50%, #415a77 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 1100px;
    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: #a8dadc;
}

/* ── INSTRUCTIONS ── */
.instructions {
    background: rgba(168,218,220,0.1);
    border-left: 4px solid #a8dadc;
    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: #a8dadc;
}

/* ── SCORE BAR ── */
.score-bar {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 20px 25px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.score-bar h3 {
    color: #a8dadc;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.score-display {
    font-size: 2.8rem;
    font-weight: 900;
    color: #69f0ae;
    line-height: 1;
}

.score-display span {
    font-size: 1rem;
    font-weight: normal;
    color: #a8dadc;
}

.progress-wrap {
    flex: 1;
    min-width: 180px;
}

.progress-label {
    font-size: 0.8rem;
    color: #a8dadc;
    margin-bottom: 6px;
}

.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, #69f0ae, #00e676);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.reset-btn {
    background: linear-gradient(135deg, #f0c040, #e67e22);
    border: none;
    border-radius: 10px;
    padding: 11px 26px;
    font-size: 0.95rem;
    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);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240,192,64,0.45);
}

/* ── TIMELINE VISUAL ── */
.timeline-section {
    margin-bottom: 30px;
}

.timeline-section h2 {
    font-size: 1rem;
    color: #a8dadc;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.timeline-visual {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px 15px 15px;
    overflow-x: auto;
}

.tl-wrap {
    min-width: 750px;
}

.tl-gradient-bar {
    height: 26px;
    border-radius: 13px;
    background: linear-gradient(to right,
        #4fc3f7, #29b6f6, #26c6da, #66bb6a,
        #d4e157, #ffca28, #ffa726, #ef5350, #c62828);
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

.tl-years {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.tl-year {
    font-size: 0.78rem;
    font-weight: bold;
    color: #f0c040;
    flex: 1;
    text-align: center;
}

.tl-events-row {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.tl-slot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tl-slot.empty {
    flex: 0.4;
}

.tl-connector {
    width: 2px;
    height: 18px;
    border-left: 2px dashed rgba(255,255,255,0.3);
}

.tl-box {
    width: 90%;
    min-height: 40px;
    background: rgba(255,255,255,0.06);
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 5px;
    line-height: 1.2;
    transition: all 0.4s ease;
}

.tl-box.correct {
    background: rgba(76,175,80,0.25);
    border: 1px solid #4CAF50;
    color: #b9f6ca;
    font-weight: bold;
}

.tl-box.wrong {
    background: rgba(244,67,54,0.2);
    border: 1px solid #f44336;
    color: #ffcdd2;
}

/* ── LEGEND ── */
.legend-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 28px;
}

.legend-box h3 {
    color: #f0c040;
    font-size: 0.95rem;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 8px;
}

.leg-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.88rem;
    color: #e0e0e0;
    line-height: 1.3;
    transition: all 0.3s;
}

.leg-item.used {
    opacity: 0.4;
}

.leg-item.surplus {
    border-color: rgba(239,83,80,0.5);
    background: rgba(239,83,80,0.08);
}

.leg-num {
    background: #f0c040;
    color: #1a1a2e;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.78rem;
}

.surplus-tag {
    display: inline-block;
    background: #ef5350;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.65rem;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── SURPLUS INFO ── */
.surplus-info {
    background: rgba(239,83,80,0.1);
    border: 2px dashed rgba(239,83,80,0.4);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
    display: none;
    animation: fadeIn 0.4s ease;
}

.surplus-info.show {
    display: block;
}

.surplus-info h3 {
    color: #ef9a9a;
    font-size: 1rem;
    margin-bottom: 8px;
}

.surplus-info p {
    font-size: 0.88rem;
    color: #e0e0e0;
    line-height: 1.5;
}

/* ── QUIZ ── */
.quiz-section h2 {
    font-size: 1.3rem;
    color: #f0c040;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 1px;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ── QUIZ CARD ── */
.quiz-card {
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 20px;
    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, #4fc3f7, #f0c040);
    opacity: 0;
    transition: opacity 0.3s;
}

.quiz-card:hover::before {
    opacity: 1;
}

.quiz-card:hover:not(.answered) {
    border-color: rgba(240,192,64,0.4);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-num {
    background: rgba(240,192,64,0.15);
    border: 1px solid rgba(240,192,64,0.4);
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: #f0c040;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-year {
    font-size: 1.5rem;
    font-weight: 900;
    color: #f0c040;
}

.question {
    font-size: 0.93rem;
    color: #c8e6ff;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* ── OPTIONS ── */
.options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-btn {
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 11px 14px;
    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.3;
}

.opt-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: rgba(255,255,255,0.5);
    transition: all 0.22s;
}

.option-btn:hover:not(:disabled) {
    background: rgba(168,218,220,0.15);
    border-color: #a8dadc;
    color: #fff;
    transform: translateX(4px);
}

.option-btn:hover:not(:disabled) .opt-icon {
    border-color: #a8dadc;
    color: #a8dadc;
}

.option-btn.correct {
    background: rgba(76,175,80,0.3) !important;
    border-color: #4CAF50 !important;
    color: #b9f6ca !important;
    font-weight: bold;
    transform: none !important;
}

.option-btn.correct .opt-icon {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

.option-btn.wrong {
    background: rgba(244,67,54,0.25) !important;
    border-color: #f44336 !important;
    color: #ffcdd2 !important;
    transform: none !important;
}

.option-btn.wrong .opt-icon {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
}

.option-btn.show-correct {
    background: rgba(76,175,80,0.15) !important;
    border-color: rgba(76,175,80,0.5) !important;
    color: #c8f7c5 !important;
}

.option-btn.show-correct .opt-icon {
    border-color: #4CAF50;
    color: #4CAF50;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

/* ── FEEDBACK ── */
.feedback {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    line-height: 1.5;
    display: none;
    animation: fadeIn 0.3s ease;
}

.feedback.show {
    display: block;
}

.feedback.correct-fb {
    background: rgba(76,175,80,0.15);
    border-left: 3px solid #4CAF50;
    color: #c8f7c5;
}

.feedback.wrong-fb {
    background: rgba(244,67,54,0.12);
    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.4);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    margin-bottom: 28px;
    animation: fadeIn 0.5s ease;
}

.final-result.show {
    display: block;
}

.result-emoji {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.final-result h2 {
    color: #f0c040;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.final-result p {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ── NAV LINKS ── */
.nav-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-links a {
    display: inline-block;
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(168,218,220,0.3);
    border-radius: 10px;
    padding: 10px 20px;
    color: #a8dadc;
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.3s;
    margin: 5px;
}

.nav-links a:hover {
    background: rgba(168,218,220,0.15);
    color: #fff;
    border-color: #a8dadc;
    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: 600px) {
    header h1 { font-size: 1.4rem; }
    .quiz-grid { grid-template-columns: 1fr; }
    .score-bar { flex-direction: column; text-align: center; }
    .card-year { font-size: 1.2rem; }
    .tl-year { font-size: 0.65rem; }
}
