/* =============================================
   COUNTRY FLAG QUIZ - PROFESSIONAL STYLESHEET
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --success-color: #27ae60;
  --error-color: #e74c3c;
  --light-bg: #ecf0f1;
  --white: #ffffff;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 0;
  color: var(--text-dark);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: auto;
}

/* ========================
   ADVERTISEMENT SECTIONS
   ======================== */

.ad-section {
  background: var(--light-bg);
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  min-height: auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.ad-section.top {
  border-bottom: 1px solid #ddd;
}

.ad-section.bottom {
  border-top: 1px solid #ddd;
  margin-top: 0;
}

.ad-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  /* animation: loading 1.5s infinite; */
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 14px;
  border-radius: 6px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========================
   QUIZ CONTENT SECTION
   ======================== */

.quiz-section {
  flex: 1;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Progress Indicator */
.progress-bar {
  background: var(--light-bg);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 30px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 600;
}

/* Question Title */
.quiz-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 50px;
}

/* Flag Container */
.flag-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 40px 0;
  min-height: 220px;
}

.flag-image {
  max-width: 100%;
  /* max-height: 200px; */
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid #e0e0e0;
  padding: 10px 10px 5px 10px;
}

.flag-image img {
    height: 100%;
    max-height: 100%;
}


/* Options Container */
.options-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 30px 0;
}

.option-button {
  padding: 20px 15px;
  border: 2px solid var(--light-bg);
  background: var(--white);
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  word-wrap: break-word;
}

.option-button:hover:not(:disabled) {
  border-color: var(--secondary-color);
  background: rgba(52, 152, 219, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
}

.option-button:active:not(:disabled) {
  transform: translateY(0);
}

.option-button:disabled {
  cursor: not-allowed;
}

.option-button.selected {
  border-color: var(--secondary-color);
  background: rgba(52, 152, 219, 0.1);
}

.option-button.correct {
  border-color: var(--success-color);
  background: rgba(39, 174, 96, 0.1);
  color: var(--success-color);
}

.option-button.incorrect {
  border-color: var(--error-color);
  background: rgba(231, 76, 60, 0.1);
  color: var(--error-color);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Feedback Messages */
.feedback {
  text-align: center;
  margin: 15px 0;
  font-size: 15px;
  font-weight: 600;
  min-height: 24px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback.success {
  color: var(--success-color);
}

.feedback.error {
  color: var(--error-color);
}

/* ========================
   NAVIGATION SECTION
   ======================== */

.navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 30px;
  border-top: 1px solid var(--light-bg);
  background: var(--white);
}

.nav-button {
  flex: 1;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.nav-button.prev {
  background: var(--light-bg);
  color: var(--text-dark);
}

.nav-button.prev:hover:not(:disabled) {
  background: #d5dbdb;
  transform: translateX(-2px);
}

.nav-button.next {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
}

.nav-button.next:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-button:active:not(:disabled) {
  transform: scale(0.98);
}

/* ========================
   RESULTS PAGE
   ======================== */

.results-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 30px;
  text-align: center;
}

.results-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.score-display {
  font-size: 64px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 30px 0;
}

.score-text {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: 30px;
}

.score-message {
  font-size: 18px;
  color: var(--text-dark);
  margin-bottom: 40px;
  line-height: 1.6;
}

.restart-button {
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
}

.restart-button:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

/* ========================
   RESPONSIVE DESIGN
   ======================== */

@media (max-width: 768px) {
  .container {
    min-height: auto;
  }

  .quiz-section {
    padding: 15px;
  }

  .quiz-title {
    font-size: 22px;
  }

  .options-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .option-button {
    padding: 18px 12px;
    font-size: 15px;
  }

  .navigation {
    flex-direction: column;
    padding: 15px 20px;
  }

  .nav-button {
    padding: 12px 20px;
    font-size: 15px;
  }

  .ad-section {
    padding: 15px;
  }

  .ad-placeholder {
    padding: 40px 15px;
    font-size: 12px;
  }

  .results-title {
    font-size: 28px;
  }

  .score-display {
    font-size: 48px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .container {
    border-radius: 4px;
  }

  .quiz-section {
    padding: 20px 15px;
  }

  .quiz-title {
    font-size: 18px;
  }

  .flag-container {
    min-height: 140px;
    margin: 20px 0;
  }

  .flag-image {
    max-height: 150px;
  }

  .option-button {
    padding: 15px 10px;
    font-size: 14px;
  }

  .navigation {
    gap: 10px;
  }

  .nav-button {
    padding: 10px 15px;
    font-size: 14px;
  }

  .results-title {
    font-size: 22px;
  }

  .score-display {
    font-size: 40px;
  }

  .score-text {
    font-size: 16px;
  }

  .score-message {
    font-size: 16px;
  }
}
