/* =============================================
   KVIZ GEOGRAFIJA - STANOVNIŠTVO
   Zajednički CSS za sve stranice kviza
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:       #1a73e8;
  --primary-dark:  #1557b0;
  --primary-light: #e8f0fe;
  --correct:       #1e8a3f;
  --correct-bg:    #d4edda;
  --correct-border:#1e8a3f;
  --wrong:         #c62828;
  --wrong-bg:      #fde8e8;
  --wrong-border:  #c62828;
  --neutral-bg:    #f5f7fa;
  --card-bg:       #ffffff;
  --text-dark:     #212121;
  --text-mid:      #555555;
  --text-light:    #888888;
  --shadow:        0 4px 20px rgba(0,0,0,0.10);
  --shadow-hover:  0 8px 30px rgba(0,0,0,0.15);
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    all 0.25s ease;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--neutral-bg);
  color: var(--text-dark);
  min-height: 100vh;
  padding: 0;
}

/* ---- Navigation Header ---- */
.site-header {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.site-header .logo {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header .logo span {
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}

/* ---- Hero / Page Title ---- */
.quiz-hero {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  padding: 40px 32px 60px;
  text-align: center;
  color: #fff;
}

.quiz-hero .topic-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 12px;
}

.quiz-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quiz-hero .subtitle {
  font-size: 1rem;
  opacity: 0.88;
  font-weight: 300;
}

/* ---- Main Container ---- */
.quiz-container {
  max-width: 820px;
  margin: -28px auto 60px;
  padding: 0 20px;
}

/* ---- Progress Bar ---- */
.progress-wrap {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 10px;
  font-weight: 500;
}

.progress-bar-outer {
  background: #e0e0e0;
  border-radius: 100px;
  height: 10px;
  overflow: hidden;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #1a73e8, #42a5f5);
  border-radius: 100px;
  transition: width 0.45s ease;
  min-width: 4px;
}

/* ---- Question Card ---- */
.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-number {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.question-text {
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text-dark);
  margin-bottom: 28px;
}

/* ---- Answer Options ---- */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-sm);
  background: #fafafa;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.97rem;
  font-weight: 400;
  color: var(--text-dark);
  text-align: left;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
  box-shadow: 0 3px 12px rgba(26,115,232,0.15);
}

.option-letter {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e8eaf6;
  color: #3949ab;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.option-btn:hover:not(:disabled) .option-letter {
  background: var(--primary);
  color: #fff;
}

/* Correct state */
.option-btn.correct {
  border-color: var(--correct-border);
  background: var(--correct-bg);
  color: var(--correct);
  font-weight: 600;
  cursor: default;
  transform: none;
  animation: correctPulse 0.4s ease;
}

.option-btn.correct .option-letter {
  background: var(--correct);
  color: #fff;
}

/* Wrong state */
.option-btn.wrong {
  border-color: var(--wrong-border);
  background: var(--wrong-bg);
  color: var(--wrong);
  font-weight: 600;
  cursor: default;
  transform: none;
  animation: shake 0.4s ease;
}

.option-btn.wrong .option-letter {
  background: var(--wrong);
  color: #fff;
}

/* Disabled (unselected after answer) */
.option-btn.disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* Icon after selection */
.option-icon {
  margin-left: auto;
  font-size: 1.1rem;
}

@keyframes correctPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  60%       { transform: translateX(5px); }
}

/* ---- Feedback Box ---- */
.feedback-box {
  display: none;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.feedback-box.show { display: block; }

.feedback-box.correct-fb {
  background: var(--correct-bg);
  border-left: 4px solid var(--correct);
  color: var(--correct);
}

.feedback-box.wrong-fb {
  background: var(--wrong-bg);
  border-left: 4px solid var(--wrong);
  color: var(--wrong);
}

/* ---- Navigation Buttons ---- */
.quiz-nav {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 100px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: #fff;
  box-shadow: 0 4px 15px rgba(26,115,232,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,115,232,0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #b0bec5;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ---- Results Panel ---- */
.results-panel {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.results-panel.show { display: block; }

.results-emoji {
  font-size: 4.5rem;
  display: block;
  margin-bottom: 16px;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.results-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.results-score {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 8px;
  line-height: 1;
}

.results-score span {
  font-size: 1.2rem;
  color: var(--text-mid);
  font-weight: 400;
}

.results-message {
  font-size: 1rem;
  color: var(--text-mid);
  margin-bottom: 32px;
  line-height: 1.6;
}

.results-bar-wrap {
  background: #e0e0e0;
  border-radius: 100px;
  height: 16px;
  overflow: hidden;
  margin: 0 auto 32px;
  max-width: 400px;
}

.results-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1s ease 0.3s;
}

.score-excellent .results-bar-fill { background: linear-gradient(90deg, #1e8a3f, #4caf50); }
.score-good      .results-bar-fill { background: linear-gradient(90deg, #1a73e8, #42a5f5); }
.score-average   .results-bar-fill { background: linear-gradient(90deg, #f57c00, #ffb74d); }
.score-low       .results-bar-fill { background: linear-gradient(90deg, #c62828, #ef5350); }

.results-detail {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.detail-item .detail-val {
  font-size: 2rem;
  font-weight: 700;
}

.detail-item .detail-val.correct-val { color: var(--correct); }
.detail-item .detail-val.wrong-val   { color: var(--wrong); }

.detail-item .detail-lbl {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.results-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 11px 28px;
  border-radius: 100px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ---- Index Page ---- */
.index-hero {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  padding: 60px 32px 80px;
  text-align: center;
  color: #fff;
}

.index-hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.index-hero p {
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: -40px auto 60px;
  padding: 0 20px;
}

.topic-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  border: 2px solid transparent;
}

.topic-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.topic-card .card-icon {
  font-size: 2.5rem;
  display: block;
}

.topic-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}

.topic-card p {
  font-size: 0.83rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.topic-card .card-meta {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid #e0e0e0;
  margin-top: 20px;
}

/* ---- Responsive ---- */
@media (max-width: 620px) {
  .quiz-hero h1         { font-size: 1.5rem; }
  .question-card        { padding: 22px 18px; }
  .question-text        { font-size: 1rem; }
  .option-btn           { font-size: 0.88rem; padding: 13px 14px; }
  .results-panel        { padding: 32px 20px; }
  .results-score        { font-size: 2.8rem; }
  .results-title        { font-size: 1.3rem; }
  .site-header          { padding: 12px 16px; }
  .nav-links a          { font-size: 0.7rem; padding: 5px 8px; }
}
