/* ==========================================================
   Eclassopedia - Global Stylesheet
   Kid-friendly, colorful, playful theme built on brand orange.
   ========================================================== */

:root {
  --brand: #f16232;
  --brand-dark: #d6511f;
  --brand-light: #fff1ea;
  --brand-soft: #ffe3d4;
  --yellow: #ffc93c;
  --blue: #4da3ff;
  --green: #3ecf8e;
  --pink: #ff6fa5;
  --white: #ffffff;
  --text: #2d2a26;
  --text-light: #77706a;
  --bg: #fffaf7;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 10px 30px rgba(241, 98, 50, 0.12);
  --shadow-card: 0 6px 20px rgba(45, 42, 38, 0.08);
  --font-main: 'Poppins', 'Segoe UI Rounded', 'Trebuchet MS', 'Verdana', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--white); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-3px); box-shadow: 0 14px 26px rgba(241,98,50,0.22); }
.btn-outline { background: var(--white); color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-light); transform: translateY(-3px); }
.btn-white { background: var(--white); color: var(--brand); }
.btn-white:hover { transform: translateY(-3px); box-shadow: 0 14px 26px rgba(0,0,0,0.15); }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; border-radius: 30px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-bounce { animation: btnPulse 2.4s ease-in-out infinite; }
@keyframes btnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

/* ---------------- Floating decorative shapes ---------------- */
.floating-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.shape {
  position: absolute;
  top: -60px;
  font-size: 2rem;
  opacity: 0.35;
  animation: floatDown 18s linear infinite;
}
@keyframes floatDown {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.35; }
  90% { opacity: 0.35; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0,0,0,0.05);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 40px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { font-weight: 600; color: var(--text); padding: 6px 4px; position: relative; }
.main-nav a.active, .main-nav a:hover { color: var(--brand); }
.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 3px;
  background: var(--brand);
  border-radius: 3px;
}
.nav-btn { margin-left: 6px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--brand); border-radius: 3px; pointer-events: none; }

/* ---------------- Hero ---------------- */
.hero { padding: 70px 0 40px; position: relative; z-index: 1; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 8px 18px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.hero-text h1 { font-size: 2.9rem; line-height: 1.2; font-weight: 800; margin-bottom: 18px; }
.text-brand { color: var(--brand); }
.hero-text p { color: var(--text-light); font-size: 1.08rem; max-width: 480px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-stats { display: flex; gap: 34px; }
.hero-stats strong { display: block; font-size: 1.6rem; color: var(--brand); }
.hero-stats span { font-size: 0.85rem; color: var(--text-light); }

.hero-art { position: relative; height: 420px; display: flex; align-items: center; justify-content: center; }
.hero-blob {
  position: absolute;
  width: 340px; height: 340px;
  background: linear-gradient(135deg, var(--brand-soft), var(--yellow));
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
  animation: blobMorph 8s ease-in-out infinite;
}
.hero-blob.small { width: 220px; height: 220px; position: static; margin: 0 auto; }
@keyframes blobMorph {
  0%, 100% { border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; }
  50% { border-radius: 45% 55% 40% 60% / 60% 40% 55% 45%; }
}
.hero-emoji { position: relative; font-size: 7rem; animation: bob 3s ease-in-out infinite; z-index: 2; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.hero-card {
  position: absolute;
  background: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: floatSway 5s ease-in-out infinite;
  z-index: 3;
}
.hero-card span { color: var(--text-light); font-weight: 600; }
.card-1 { top: 10%; left: 0%; animation-delay: 0s; }
.card-2 { top: 55%; right: -4%; animation-delay: 1.5s; }
.card-3 { bottom: 6%; left: 14%; animation-delay: 3s; }
@keyframes floatSway {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}

/* ---------------- Sections ---------------- */
.section { padding: 60px 0; position: relative; z-index: 1; }
.section-alt { background: var(--brand-light); }
.section-title { text-align: center; font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--text-light); margin-bottom: 40px; }

.page-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--white);
  padding: 70px 0;
  text-align: center;
  position: relative;
  z-index: 1;
}
.page-hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 10px; }
.page-hero p { opacity: 0.92; font-size: 1.05rem; }

/* ---------------- Grid & Cards ---------------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 2px solid transparent;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-soft); border-color: var(--brand-soft); }
.card-icon { font-size: 2.2rem; margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--text-light); font-size: 0.92rem; }

.worksheet-card { text-align: left; display: block; }
.tag {
  display: inline-block;
  margin-top: 12px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
}

.empty-state { text-align: center; color: var(--text-light); padding: 30px; grid-column: 1 / -1; }

/* ---------------- Steps (How it works) ---------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px 18px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.step-num {
  position: absolute;
  top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--brand);
  color: var(--white);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem;
}
.step-emoji { font-size: 2.4rem; margin: 14px 0 10px; }
.step h3 { margin-bottom: 6px; }
.step p { color: var(--text-light); font-size: 0.88rem; }

/* ---------------- Testimonials ---------------- */
.testimonial-card p { font-style: italic; color: var(--text); margin-bottom: 16px; }
.testimonial-user { font-weight: 700; color: var(--brand-dark); font-size: 0.9rem; }

/* ---------------- CTA ---------------- */
.cta-section { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: var(--white); }
.cta-inner { text-align: center; }
.cta-inner h2 { font-size: 2rem; margin-bottom: 10px; }
.cta-inner p { opacity: 0.92; margin-bottom: 26px; }

/* ---------------- About page ---------------- */
.about-grid { align-items: center; }
.about-art { position: relative; text-align: center; }
.about-emoji { position: relative; font-size: 3.5rem; z-index: 2; letter-spacing: 20px; }

/* ---------------- Footer ---------------- */
.site-footer { background: #2a2118; color: #f2e9e2; padding: 50px 0 0; position: relative; z-index: 1; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 30px; padding-bottom: 30px; }
.footer-logo-img { height: 46px; }
.footer-tagline { color: #c9beb4; margin-top: 10px; font-size: 0.85rem; }
.footer-links h4, .footer-contact h4 { margin-bottom: 14px; font-size: 0.95rem; color: var(--yellow); }
.footer-links a { display: block; margin-bottom: 8px; color: #d8cfc7; font-size: 0.9rem; }
.footer-links a:hover { color: var(--white); }
.footer-contact p { color: #d8cfc7; font-size: 0.88rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); text-align: center; padding: 16px 0; font-size: 0.82rem; color: #b6ab9f; }

/* ---------------- Alerts / Flash ---------------- */
.alert {
  max-width: 1200px;
  margin: 16px auto;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.alert-success { background: #e4faf1; color: #17875a; }
.alert-error { background: #fde8e4; color: #c0341c; }
.alert-info { background: #e6f2ff; color: #1a5aa8; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 700; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px;
  border: 2px solid #eee0d8;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color 0.2s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
}

/* ---------------- Password show/hide toggle ---------------- */
.password-field-wrap { position: relative; }
.password-field-wrap input {
  width: 100%;
  padding-right: 46px !important;
}
.password-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-light);
  border-radius: 50%;
}
.password-toggle-btn:hover { color: var(--brand); background: var(--brand-light); }
.password-toggle-btn:focus { outline: none; color: var(--brand); }

/* ---------------- Themed dropdowns (every <select> site-wide) ---------------- */
.form-group select,
.search-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23f16232' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 38px;
  cursor: pointer;
}
.form-group select::-ms-expand,
.search-form select::-ms-expand {
  display: none;
}
.form-group select:hover,
.search-form select:hover {
  border-color: var(--brand);
}
.form-group select:disabled,
.search-form select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.form-group input:disabled { background: #f6f2ee; color: var(--text-light); }
.form-grid { gap: 12px 24px; margin-bottom: 6px; }

/* ---------------- Modal ---------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(45,42,38,0.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.25s ease; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: popIn 0.3s ease;
}
.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 1.6rem; color: var(--text-light);
}
.modal-emoji { font-size: 3rem; margin-bottom: 10px; }
.modal-box h3 { margin-bottom: 8px; font-size: 1.2rem; }
.modal-box p { color: var(--text-light); margin-bottom: 22px; }
.modal-actions { display: flex; gap: 14px; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------------- Contact Page ---------------- */
.contact-grid { align-items: center; }
.contact-card h2 { margin-bottom: 18px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { height: 300px; order: -1; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    gap: 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    display: none;
  }
  .main-nav.open { display: flex; }
  .hero-text h1 { font-size: 2.1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
