/* ================= ROOT ================= */

:root {
  --primary: #2563eb;
  --bg: #f5f9ff;
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: 0.5s ease;
}



/* ================= NAVBAR FIX ================= */

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: white;
  padding: 18px 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 3px 15px rgba(0,0,0,0.05);
}

/* ================= HERO SKY ================= */

.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8%;
  background: linear-gradient(to top, #dbeafe, #87ceeb);
  position: relative;
  overflow: hidden;
}

/* Clouds */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 110px;
  background: white;
  border-radius: 100px;
  opacity: 0.6;
  animation: cloudMove 70s linear infinite;
}

.hero::before { top: 25%; left: -300px; }
.hero::after { top: 45%; left: -350px; animation-delay: 20s; }

@keyframes cloudMove {
  from { transform: translateX(0); }
  to { transform: translateX(160vw); }
}

/* ================= HERO TEXT ================= */

.hero-content h1 {
  font-size: 42px;
  margin-bottom: 20px;
}

.hero-content p {
  max-width: 650px;
  margin: auto;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

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

/* Buttons */
.btn {
  padding: 10px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: 0.3s;
}

.btn.primary {
  background: var(--primary);
  color: white;
}

.btn.secondary {
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn.secondary:hover {
  background: var(--primary);
  color: white;
}

.toggle-btn {
  margin-top: 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

/* ================= NIGHT MODE ================= */

body.night {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
}

body.night header {
  background: #0f172a;
}

body.night .hero {
  background: linear-gradient(to top, #0f172a, #1e3a8a);
}

/* Moon */
body.night .hero::before {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #facc15;
  top: 15%;
  left: 75%;
  animation: none;
}

/* Stars */
body.night .hero::after {
  width: 100%;
  height: 100%;
  background: transparent;
  box-shadow:
    200px 200px white,
    400px 150px white,
    600px 250px white,
    900px 100px white,
    1200px 180px white;
  animation: none;
}

/* ================= FLASHCARDS FIXED ================= */

.countries-container {
  padding: 100px 8%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 45px; /* MORE SPACE */
}

@media (max-width: 1100px) {
  .countries-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .countries-container {
    grid-template-columns: 1fr;
  }
}

.card {
  perspective: 1500px;
}

.card-inner {
  width: 100%;
  height: 500px; /* INCREASED HEIGHT */
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  backface-visibility: hidden;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* FRONT */

.card-front img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-front h2 {
  padding: 15px;
  font-size: 18px;
}

.card-front p {
  padding: 0 15px;
  font-size: 14px;
  color: var(--muted);
}

/* BACK */

.card-back {
  transform: rotateY(180deg);
  padding: 20px;
  overflow-y: auto; /* FIX CONTENT CUT */
}

.card-back h2 {
  font-size: 17px;
  margin-bottom: 15px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-card {
  background: #f1f5f9;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}

body.night .mini-card {
  background: #334155;
}/* ===============================
   GLOBAL RESET
================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background: #f0f9ff;
  color: #1e293b;
  line-height: 1.6;
  transition: all 0.4s ease;
}

/* ===============================
   NAVBAR
================================= */

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(240, 245, 245, 0.95);
  backdrop-filter: blur(10px);
  padding: 18px 8%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #080a0f;
}

nav {
  display: flex;
  gap: 35px;
}

nav a {
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  position: relative;
  transition: 0.3s;
}

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

nav a:hover::after {
  width: 100%;
}

nav a:hover {
  color: #2563eb;
}

/* ===============================
   HERO SKY
================================= */

.hero {
  height: 90vh;
  background: linear-gradient(to top, #dbeafe, #87ceeb);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8%;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: 44px;
  margin-bottom: 20px;
}

.hero p {
  max-width: 650px;
  margin: auto;
  font-size: 16px;
  color: #475569;
}

.hero-buttons {
  margin-top: 35px;
  display: flex;
  gap: 20px;
  justify-content: center;
}

.btn {
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: 0.3s;
}

.btn.primary {
  background: #2563eb;
  color: white;
}

.btn.primary:hover {
  background: #1d4ed8;
}

.btn.secondary {
  border: 2px solid #2563eb;
  color: #2563eb;
}

.btn.secondary:hover {
  background: #2563eb;
  color: white;
}

/* ===============================
   FLASHCARDS SECTION
================================= */

.countries-container {
  padding: 100px 8%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
}

/* Smaller Cards */
.card {
  perspective: 1500px;
}

.card-inner {
  width: 100%;
  height: 380px; /* smaller */
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  backface-visibility: hidden;
  background: rgb(182, 208, 214);
  box-shadow: 0 12px 25px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* FRONT */

.card-front img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card-front h2 {
  font-size: 16px;
  padding: 12px;
}

.card-front p {
  padding: 0 12px;
  font-size: 13px;
  color: #64748b;
}

/* BACK */

.card-back {
  transform: rotateY(180deg);
  padding: 15px;
  overflow-y: auto;
}

.card-back h2 {
  font-size: 15px;
  margin-bottom: 10px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-card {
  background: #f1f5f9;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}

/* ===============================
   ABOUT SECTION
================================= */

.about-page {
  padding: 100px 8%;
  background: white;
  text-align: center;
}

.about-page h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

.about-page p {
  max-width: 700px;
  margin: auto;
  color: #64748b;
}

.features-grid {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.feature-card {
  background: #f8fafc;
  padding: 30px;
  border-radius: 14px;
  transition: 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* ===============================
   CONTACT SECTION
================================= */

.contact-page {
  padding: 100px 8%;
  background: #f1f5f9;
  text-align: center;
}

.contact-page h2 {
  font-size: 30px;
  margin-bottom: 40px;
}

.contact-page form {
  max-width: 500px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-page input,
.contact-page textarea {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
}

.contact-page textarea {
  resize: none;
  height: 120px;
}

.contact-page button {
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.contact-page button:hover {
  background: #1d4ed8;
}

/* ===============================
   FOOTER
================================= */

footer {
  padding: 30px;
  text-align: center;
  background: white;
  font-size: 14px;
  color: #64748b;
}

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

@media (max-width: 1100px) {
  .countries-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .countries-container {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 28px;
  }
}

/* ============================= */
/* 🌙 DARK MODE SKY BACKGROUND  */
/* ============================= */

body.dark {
  background: linear-gradient(to top, #0f2027, #203a43, #2c5364);
  position: relative;
  overflow-x: hidden;
  transition: background 0.6s ease;
}

/* ===== Animated Stars ===== */

body.dark::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, white, transparent),
    radial-gradient(2px 2px at 60% 20%, white, transparent),
    radial-gradient(1.5px 1.5px at 80% 60%, white, transparent),
    radial-gradient(2px 2px at 10% 80%, white, transparent),
    radial-gradient(1.5px 1.5px at 90% 40%, white, transparent),
    radial-gradient(2px 2px at 50% 50%, white, transparent);
  background-repeat: repeat;
  animation: twinkle 4s infinite alternate;
  z-index: -2;
}

/* ===== Moon ===== */

body.dark::after {
  content: "";
  position: fixed;
  top: 80px;
  right: 100px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 30% 30%, #fff, #ddd);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.8),
              0 0 80px rgba(255, 255, 255, 0.4);
  animation: moonFloat 6s ease-in-out infinite;
  z-index: -1;
}

/* ===== Animations ===== */

@keyframes twinkle {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

@keyframes moonFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.flag {
  width: 40px;
  height: auto;
}


