/* ========================================
   Maple Education - Main Stylesheet
   ======================================== */

:root {
  --primary: #4A90D9;
  --primary-light: #6BA8E8;
  --primary-dark: #3A7BC8;
  --accent: #E84A27;
  --accent-light: #F06847;
  --green: #A4C639;
  --sky: #A8D8EA;
  --text: #2D2D2D;
  --text-light: #555555;
  --bg: #ffffff;
  --bg-alt: #F5FAFC;
  --bg-dark: #2D2D2D;
  --border: #e0e0e0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

/* ========================================
   Layout
   ======================================== */

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

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.text-center {
  text-align: center;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

/* ========================================
   Header & Navigation
   ======================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.logo img {
  height: 50px;
  width: auto;
  border-radius: 6px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-en {
  font-size: 1.1rem;
}

.logo-zh {
  font-size: 0.85rem;
  color: var(--accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

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

.nav-contact {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.lang-switch:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

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

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

.btn-accent:hover {
  background: var(--accent-light);
  color: white;
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 72px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 150%;
  background: radial-gradient(circle, rgba(11, 79, 74, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  margin-bottom: 1.5rem;
}

.hero-text h1 span {
  color: var(--accent);
}

.hero-text .lead {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: left;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sky) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: var(--primary-dark);
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card p {
  margin-bottom: 1.5rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 600;
}

.card-link:hover {
  gap: 12px;
}

/* ========================================
   Features Section
   ======================================== */

.features {
  padding: 100px 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px;
}

.section-header .overline {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

/* ========================================
   Contact Info
   ======================================== */

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.contact-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.contact-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 10px;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-info h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.contact-info p {
  margin: 0;
  font-size: 0.9rem;
}

.contact-info a {
  color: var(--text);
  font-weight: 500;
}

.contact-info a:hover {
  color: var(--primary);
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--bg-dark);
  color: white;
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  margin: 1rem 0;
}

.footer h4 {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: white;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--accent);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   Page Header (for inner pages)
   ======================================== */

.page-header {
  padding: 140px 0 60px;
  background: linear-gradient(135deg, var(--primary) 0%, #3A7BC8 100%);
  color: white;
  text-align: center;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a:hover {
  color: white;
}

.breadcrumb span {
  color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   Service Cards (Services Page)
   ======================================== */

.service-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-image {
  height: 200px;
  background: linear-gradient(135deg, var(--sky) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.service-content {
  padding: 24px;
}

.service-content h3 {
  margin-bottom: 0.5rem;
}

.service-content p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.service-features {
  list-style: none;
  margin-bottom: 1.5rem;
}

.service-features li {
  padding: 6px 0;
  padding-left: 24px;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-light);
}

.service-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* ========================================
   Team Section (About Page)
   ======================================== */

.team-card {
  text-align: center;
  padding: 32px;
}

.team-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.team-card h4 {
  margin-bottom: 0.25rem;
}

.team-card .role {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

/* ========================================
   Contact Form
   ======================================== */

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 79, 74, 0.1);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ========================================
   Map Section
   ======================================== */

.map-container {
  height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ========================================
   CTA Section
   ======================================== */

.cta-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--primary) 0%, #3A7BC8 100%);
  color: white;
  text-align: center;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto 2rem;
}

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

.cta-section .btn-primary:hover {
  background: var(--accent);
  color: white;
}

/* ========================================
   Responsive Design
   ======================================== */

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

  .hero-stats {
    justify-content: center;
  }

  .hero-image {
    order: -1;
    max-width: 500px;
    margin: 0 auto;
  }

  .hero-buttons {
    justify-content: center;
  }

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

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

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .nav-links,
  .nav-contact {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav {
    height: 60px;
  }

  .logo img {
    height: 40px;
  }

  .hero {
    min-height: auto;
    padding: 100px 0 60px;
  }

  .hero-image img {
    height: 250px;
  }

  .hero-stats {
    flex-direction: row;
    gap: 30px;
    flex-wrap: wrap;
  }

  .stat-number {
    font-size: 2rem;
  }

  .section {
    padding: 50px 0;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .page-header {
    padding: 100px 0 40px;
  }

  .card {
    padding: 24px;
  }

  .card-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    width: 100%;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .contact-methods {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .cta-section {
    padding: 50px 0;
  }

  .cta-section .btn {
    width: auto;
  }

  .map-container {
    height: 300px;
  }

  /* Service page mobile */
  .grid-2[style*="align-items:center"] {
    gap: 30px !important;
  }

  .grid-2[style*="align-items:center"] img {
    height: 200px !important;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .hero-stats {
    gap: 20px;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .overline {
    font-size: 0.75rem;
  }
}

/* ========================================
   Animations & Effects
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fadeInUp {
  animation: fadeInUp 0.7s ease forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.7s ease forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.7s ease forwards;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Hover Effects */
.card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(74, 144, 217, 0.15);
}

.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(74, 144, 217, 0.4);
}

.btn-accent:hover {
  box-shadow: 0 10px 30px rgba(232, 74, 39, 0.4);
}

/* Image hover effects */
.hero-image img,
.service-card img,
section img[style*="object-fit"] {
  transition: transform 0.5s ease;
}

.hero-image:hover img,
.service-card:hover img {
  transform: scale(1.05);
}

/* Contact card hover */
.contact-card {
  transition: all 0.3s ease;
}

.contact-card:hover {
  transform: translateX(10px);
  border-left: 4px solid var(--primary);
}

.contact-card:hover .contact-icon {
  animation: pulse 0.5s ease;
}

/* Stats animation */
.stat-number {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Logo hover */
.logo:hover img {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* Nav link underline animation */
.nav-links a::after {
  transition: width 0.3s ease, background-color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

/* Gradient backgrounds */
.hero::before {
  background: radial-gradient(circle at 80% 20%, rgba(74, 144, 217, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(164, 198, 57, 0.1) 0%, transparent 50%);
}

/* Section decorations */
.section-header .overline {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, var(--sky) 0%, rgba(74, 144, 217, 0.2) 100%);
  border-radius: 20px;
  margin-bottom: 1rem;
}

/* Card icon gradient */
.card-icon {
  background: linear-gradient(135deg, var(--sky) 0%, var(--primary-light) 100%);
  box-shadow: 0 8px 20px rgba(74, 144, 217, 0.2);
}

/* CTA section animated gradient */
.cta-section {
  background: linear-gradient(-45deg, var(--primary), var(--primary-dark), #3A7BC8, var(--primary-light));
  background-size: 400% 400%;
  animation: gradientMove 8s ease infinite;
}

/* Footer hover effects */
.footer-links a {
  position: relative;
  display: inline-block;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.footer-links a:hover::after {
  width: 100%;
}

/* Social links */
.social-links a {
  transition: all 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-5px) scale(1.1);
}

/* ========================================
   Utilities
   ======================================== */

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
