:root {
  /* Color Palette - SpeakChile Official (All Orange) */
  --primary: #e2762b; /* Orange */
  --primary-light: #f18d4d;
  --secondary: #f18d4d; /* Using a lighter orange instead of blue */
  --accent: #cf2e2e; /* Red */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-700: #374151;
  --gray-900: #111827;
  --black: #000000;
  
  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.2);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Hero Section with Video Background */
.hero {
  position: relative;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--white);
  text-align: center;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -1;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* Dark overlay for text readability */
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  color: var(--white);
  font-size: 3.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-content p {
  color: var(--white);
  font-size: 1.5rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

p {
  color: var(--gray-700);
  font-size: 1.125rem;
}

/* Header */
header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: var(--glass-bg);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: -0.025em;
}

.logo span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  transition: var(--transition);
}

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

/* Testimonials - More Elegant and Compact */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.testimonial-card {
  background: var(--white);
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  position: relative;
  border: 1px solid var(--gray-100);
  min-width: 200px; /* Ensure they don't crush too much on mobile */
}

.stars {
  color: #ffc107;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.testimonial-text {
  font-style: italic;
  color: var(--gray-300);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  font-size: 0.8rem; /* Smaller text for elegance */
}

.testimonial-author {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.google-icon {
  width: 18px;
  height: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

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

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

/* Course Grid */
/* Course Tabs Navigation */
.course-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
  padding: 0.5rem;
  background: var(--gray-100);
  border-radius: 100px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--gray-700);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.course-group.hidden {
  display: none;
}

.course-group {
  animation: fadeIn 0.5s ease-out;
}

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

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.blog-card {
  background: var(--white);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: var(--transition);
  border: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
}

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

.blog-card-image {
  height: 220px;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.blog-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-card-content p {
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.blog-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-link:hover {
  text-decoration: underline;
}

/* Course Grouping & Grid */
.course-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 2rem;
}

.course-group {
  background: var(--white);
  border-radius: 2rem;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}

.course-group:hover {
  box-shadow: 0 15px 40px rgba(0,0,0,0.06);
}

.course-group-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-50);
}

.course-group-header img.group-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-md);
}

.course-group-info h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.course-badge {
  display: inline-block;
  background: var(--secondary);
  color: var(--white);
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.plan-card {
  background: var(--gray-50);
  padding: 2.5rem;
  border-radius: 1.5rem;
  text-align: center;
  border: 2px solid transparent;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.plan-card:hover {
  background: var(--white);
  border-color: var(--primary);
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.plan-card h3 {
  font-size: 1.4rem;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.plan-card .price {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.plan-card .duration {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 2rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-card .btn {
  width: 100%;
}

.plan-card.featured {
  background: linear-gradient(135deg, #fff 0%, var(--gray-50) 100%);
  border-color: var(--primary-light);
  position: relative;
  overflow: hidden;
}

.plan-card.featured::after {
  content: "Popular";
  position: absolute;
  top: 1rem;
  right: -2rem;
  background: var(--primary);
  color: var(--white);
  padding: 0.25rem 3rem;
  font-size: 0.7rem;
  font-weight: 800;
  transform: rotate(45deg);
}

.course-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-top: 1rem;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}


/* Form Styles */
.form-section {
  background: var(--white);
  padding: 3rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 4rem auto;
}

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

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

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

/* Chatbot Styles */
.chatbot-launcher {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: var(--transition);
}

.chatbot-launcher:hover {
  transform: scale(1.1);
}

.chatbot-launcher img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white);
}

.chatbot-container {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 350px;
  height: 500px;
  background: var(--white);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.chat-header {
  background: var(--primary);
  color: var(--white);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.chat-messages {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--gray-50);
}

.message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.9rem;
}

.message.bot {
  background: var(--gray-200);
  align-self: flex-start;
  border-bottom-left-radius: 0;
}

.message.user {
  background: var(--primary);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 0;
}

.bot-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.bot-btn {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.chat-input {
  padding: 1rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--gray-200);
}

.chat-input input {
  flex-grow: 1;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 2rem;
  outline: none;
}

.chat-input button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  cursor: pointer;
}

/* Terms Modal Styles */
.terms-content {
    background: var(--white);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    border-radius: 1.5rem;
    padding: 3rem;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.terms-header {
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.terms-header h2 {
    color: var(--accent);
    font-size: 1.8rem;
}

.terms-body {
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.terms-item {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.terms-item strong {
    color: var(--primary);
    min-width: 30px;
}

.terms-acceptance {
    background: var(--gray-50);
    padding: 1.5rem;
    border-radius: 1rem;
    margin-top: 2rem;
    border: 1px solid var(--gray-200);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}

.checkbox-container input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* --- Responsive Design (Mobile First) --- */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-content p {
    font-size: 1.1rem;
  }

  .course-tabs {
    border-radius: 20px;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    flex-grow: 1;
    text-align: center;
  }

  .course-group {
    padding: 1.5rem;
    border-radius: 1.5rem;
  }

  .course-group-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .course-group-header img.group-img {
    width: 100px;
    height: 100px;
  }

  .course-group-info h2 {
    font-size: 1.8rem;
  }

  .plan-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .plan-card {
    padding: 2rem 1.5rem;
  }

  .blog-grid {
    grid-template-columns: 1fr !important;
  }

  .terms-content {
    padding: 1.5rem;
    width: 95%;
  }

  .terms-header h2 {
    font-size: 1.4rem;
  }

  .course-grid {
    padding: 0;
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
  }

  .testimonial-card {
    min-width: 280px;
    scroll-snap-align: center;
  }

  .container {
    padding: 2rem 1rem !important;
  }

  /* Form and Modals */
  .form-section {
    padding: 1.5rem;
  }

  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Chatbot adjustments */
  .chatbot-container {
    width: calc(100% - 2rem);
    right: 1rem;
    bottom: 5rem;
    height: 400px;
  }

  /* Gallery scroll buttons visibility */
  #gallery-carousel {
    padding: 0 1rem;
  }
  
  #nosotros div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
}

/* --- Payment Method Selection (Global) --- */
.payment-methods {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.payment-methods-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--gray-900);
    text-align: left;
}

.method-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.method-card {
    border: 2px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    position: relative;
    background: var(--white);
}

.method-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.method-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.method-card.selected {
    border-color: var(--primary);
    background: rgba(226, 118, 43, 0.05);
}

.method-icon {
    font-size: 1.8rem;
}

.method-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-900);
}

/* Transfer Section Styles */
#transferSection {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 2rem;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bank-details {
    margin-bottom: 1.5rem;
    background: white;
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.bank-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 0.5rem;
}

.bank-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.bank-row span:first-child {
    color: var(--gray-700);
    font-weight: 500;
}

.bank-row span:last-child {
    font-weight: 700;
    color: var(--primary);
}

.file-upload-container {
    background: white;
    border: 2px dashed var(--gray-200);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.file-upload-container:hover, .file-upload-container.dragover {
    border-color: var(--primary);
    background: rgba(226, 118, 43, 0.02);
}

.file-upload-container label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.file-upload-container input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.upload-text {
    font-size: 0.9rem;
    color: var(--gray-700);
    font-weight: 500;
}

.file-selected-name {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    background: rgba(226, 118, 43, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: inline-block;
}

@media (max-width: 480px) {
    .method-options {
        grid-template-columns: 1fr;
    }
}

/* Gallery & Lightbox Enhancements */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

.gallery-item {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    cursor: pointer;
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.gallery-item img, .gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img, .gallery-item:hover video {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(226, 118, 43, 0.9);
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    z-index: 2;
    border: 3px solid white;
}

#lightbox-video {
    width: 90%;
    max-width: 1000px;
    height: 75vh;
    border: none;
    border-radius: 1.5rem;
    display: none;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* Floating Spanish School portal switcher badge */
.spanishschool-portal-badge {
    position: fixed;
    right: 0;
    top: 35%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #005899, #003e6b);
    color: #ffffff !important;
    padding: 12px 16px;
    font-family: "Outfit", "Source Sans Pro", sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none !important;
    border-radius: 8px 0 0 8px;
    z-index: 100000;
    box-shadow: -2px 4px 12px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 2px solid #fcd116;
}

.spanishschool-portal-badge:hover {
    padding-right: 24px;
    background: linear-gradient(135deg, #003e6b, #005899);
    box-shadow: -4px 6px 16px rgba(0,0,0,0.3);
}

.spanishschool-portal-badge svg {
    width: 16px;
    height: 16px;
    fill: #fcd116;
}

/* On mobile, position it at the bottom-left to avoid overlapping the chatbot launcher */
@media (max-width: 768px) {
    .spanishschool-portal-badge {
        top: auto;
        bottom: 2rem;
        right: auto;
        left: 2rem;
        transform: none;
        border-radius: 50px;
        padding: 10px 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        border: 1px solid rgba(252, 209, 22, 0.4);
    }
    .spanishschool-portal-badge:hover {
        padding-right: 16px;
    }
}
