/* ============================= */
/* ===== GLOBAL SETTINGS ====== */
/* ============================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 30% 20%, rgba(46,125,50,0.12), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,150,255,0.06), transparent 50%),
    #0f0f0f;
  background-size: 200% 200%;
  animation: slowPulse 15s ease infinite;
  color: #fff;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================= */
/* ===== NAVIGATION ============ */
/* ============================= */

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 50px;
  background: rgba(15,15,15,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-logo {
  font-weight: bold;
  font-size: 18px;
}

.main-nav nav {
  display: flex;
  gap: 30px;
}

.main-nav a {
  position: relative;
  color: #aaa;
  font-weight: 500;
  transition: 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
}

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0%;
  height: 2px;
  background: #2e7d32;
  transition: 0.3s;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

/* ============================= */
/* ===== PAGE WRAPPER ========== */
/* ============================= */

.page-wrapper {
  max-width: 1400px;
  margin: 120px auto 80px;
  padding: 0 40px;
  min-height: calc(100vh - 100px);
}

.page-title {
  font-size: 40px;
  margin-bottom: 40px;
  text-shadow: 0 0 20px rgba(46,125,50,0.3);
}

/* ============================= */
/* ===== FILTER BAR ============ */
/* ============================= */

.filters-bar {
  display: flex;
  justify-content: center;
  gap: 15px;
  max-width: 700px;
  margin: 30px auto 50px auto;
  padding: 18px 25px;
  background: rgba(20,20,20,0.7);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
}

.filters-bar input,
.filters-bar select {
  background: #111;
  border: 1px solid #2a2a2a;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  transition: 0.3s ease;
}

.filters-bar input {
  flex: 1;
}

.filters-bar input:focus,
.filters-bar select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46,125,50,0.2);
}

/* ============================= */
/* ===== FLAGS GRID ============ */
/* ============================= */

#flags-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 25px;
  margin: 40px auto;
}

/* ============================= */
/* ===== FLAG CARD ============= */
/* ============================= */

.card {
  background: rgba(20,20,20,0.85);
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: all 0.3s ease;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeIn 0.35s ease forwards;
}

.card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: 0.3s ease;
}

.card p {
  font-size: 13px;
  margin-bottom: 2px;
}

.card small {
  font-size: 11px;
  color: #aaa;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #2e7d32;
  box-shadow: 0 10px 30px rgba(46,125,50,0.25);
}

.card:hover img {
  transform: scale(1.05);
}

/* ============================= */
/* ===== PAGINATION ============ */
/* ============================= */

#pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

#pagination button {
  padding: 8px 14px;
  background: #111;
  color: white;
  border: 1px solid #2a2a2a;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.2s ease;
}

#pagination button:hover {
  border-color: #2e7d32;
  background: #1c1c1c;
}

#pagination button.active-page {
  background: #2e7d32;
  border-color: #2e7d32;
}

/* ============================= */
/* ===== FLAG DETAIL PAGE ====== */
/* ============================= */

.flag-detail-card {
  max-width: 800px;
  margin: 80px auto;
  padding: 40px;
  background: rgba(20,20,20,0.85);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transition: 0.4s ease;
}

.flag-detail-card:hover {
  box-shadow: 0 30px 80px rgba(46,125,50,0.25);
}

.flag-detail-image {
  width: 100%;
  max-width: 500px;
  border-radius: 14px;
  margin-bottom: 25px;
}

.flag-meta {
  margin: 20px 0;
  font-size: 16px;
  color: #ccc;
}

.flag-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.download-btn,
.back-btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
  border: none;
  text-decoration: none;
}

.download-btn {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: #fff;
  box-shadow: 0 8px 20px rgba(46,125,50,0.3);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(46,125,50,0.4);
}

.back-btn {
  background: #111;
  color: #aaa;
  border: 1px solid #2a2a2a;
}

.back-btn:hover {
  color: #fff;
  border-color: #2e7d32;
}

/* ============================= */
/* ===== ANIMATIONS ============ */
/* ============================= */

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slowPulse {
  0% { background-position: 30% 20%, 80% 70%; }
  50% { background-position: 35% 25%, 75% 65%; }
  100% { background-position: 30% 20%, 80% 70%; }
}

/* ============================= */
/* ===== RESPONSIVE ============ */
/* ============================= */

@media (max-width: 900px) {
  #flags-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .flag-detail-card {
    margin: 40px 20px;
  }
}

/* ============================= */
/* ===== LANDING / HOME ======== */
/* ============================= */

.landing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 1200px;
  margin: 120px auto 80px;
  padding: 0 40px;
  gap: 60px;
  min-height: 70vh;
}

.landing-left h1 {
  font-size: 64px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.landing-left p {
  color: #aaa;
  font-size: 18px;
  margin-bottom: 20px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  padding: 14px 26px;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  border-radius: 14px;
  font-weight: 600;
  transition: 0.3s ease;
  box-shadow: 0 10px 30px rgba(46,125,50,0.3);
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(46,125,50,0.5);
}

/* Right side cards */

.landing-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.home-card {
  display: block;
  background: rgba(30,30,30,0.6);
  backdrop-filter: blur(12px);
  padding: 35px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.4s ease;
  overflow: hidden;
  text-align: left;
}

.home-card:hover {
  transform: translateY(-10px);
  border-color: #2e7d32;
  box-shadow: 0 20px 60px rgba(46,125,50,0.35);
}

.card-icon {
  font-size: 32px;
  margin-bottom: 15px;
  transition: 0.3s ease;
}

.home-card:hover .card-icon {
  transform: scale(1.15) rotate(5deg);
}

/* Responsive */

@media (max-width: 900px) {
  .landing {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .landing-right {
    grid-template-columns: 1fr;
  }
}

/* ============================= */
/* ===== PROGRESSION SECTION ==== */
/* ============================= */

.progression-section {
  padding: 120px 20px;
  background: linear-gradient(180deg, #111, #0c0c0c);
  text-align: center;
  margin-top: 80px;
}

.progression-section .content {
  max-width: 900px;
  margin: 0 auto;
}

.progression-section h2 {
  font-size: 32px;
  margin-bottom: 15px;
}

.progression-section p {
  color: #aaa;
  max-width: 600px;
  margin: 0 auto;
  font-size: 16px;
}

/* ============================= */
/* ===== QUIZ PAGE ============= */
/* ============================= */

.quiz-setup {
  max-width: 650px;
  margin: 40px auto;
  padding: 25px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;

  background: rgba(20,20,20,0.85);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.quiz-setup select {
  background: #111;
  border: 1px solid #2a2a2a;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
}

.quiz-setup select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46,125,50,0.2);
}

.quiz-setup button {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}

.quiz-setup button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(46,125,50,0.4);
}

.quiz-card {
  max-width: 650px;
  margin: 40px auto;
  padding: 35px;
  background: rgba(20,20,20,0.85);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.quiz-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  font-size: 14px;
  color: #aaa;
}

.quiz-image-box {
  text-align: center;
  margin-bottom: 30px;
}

.quiz-image-box img {
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.answers-grid {
  display: grid;
  gap: 15px;
}

.answer-btn {
  padding: 14px;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.25s ease;
  text-align: center;
}

.answer-btn:hover {
  border-color: #2e7d32;
  background: #1a1a1a;
  transform: translateY(-2px);
}

.answer-btn.correct {
  background: rgba(46,125,50,0.2);
  border-color: #2e7d32;
}

.answer-btn.wrong {
  background: rgba(200,50,50,0.2);
  border-color: #c62828;
}

.quiz-collection {
  margin-top: 25px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}