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

body {
  font-family: 'Nunito', system-ui, -apple-system, 'Noto Sans TC', Arial, sans-serif;
  min-height: 100vh;
  padding-top: 52px; /* Increased to account for beta banner (40px) + original (12px) */
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-warm) 50%, var(--bg-warmest) 100%);
  overflow-x: hidden;
}

/* Beta Testing Banner */
.beta-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--secondary-color);
  color: white;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.beta-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.beta-feedback-link {
  color: var(--primary-lighter);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.beta-feedback-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Mobile responsive for beta banner */
@media (max-width: 768px) {
  .beta-banner-content {
    padding: 6px 15px;
    font-size: 13px;
  }
  
  body {
    padding-top: 46px; /* Slightly less padding for mobile */
  }
}

/* Moving Flowers Animation */
.moving-flowers-left {
  position: absolute;
  left: -20px;
  top: 40%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
}

.moving-flowers-left img {
  max-width: 220px;
  height: auto;
  opacity: 0.8;
}

/* Moving Flowers Animation - Right Side */
.moving-flowers-right {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
}

.moving-flowers-right img {
  max-width: 220px;
  height: auto;
  opacity: 0.8;
  transform: scaleX(-1);
}

/* Floating Navigation Bar */
.nav-bar {
  position: relative;
  margin: 0 auto;
  background: transparent;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%;
  max-width: 1200px;
}

.nav-logo {
  font-family: 'Nunito', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 64px;
  width: auto;
  object-fit: contain;
  transition: all 0.2s ease;
}

.nav-logo:hover .nav-logo-img {
  transform: scale(1.05);
}

/* Navigation center section */
.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Navigation right section */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Navigation links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--primary-alpha-20);
  color: var(--primary-accent);
}

/* Navigation buttons */
.nav-button {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}

.nav-button-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--text-primary);
}

.nav-button-outline:hover {
  background: var(--text-primary);
  color: white;
}

.nav-button-primary {
  background: var(--secondary-color);
  color: white;
  border: 2px solid var(--secondary-color);
}

.nav-button-primary:hover {
  background: var(--secondary-hover);
  border-color: var(--secondary-hover);
  transform: translateY(-1px);
}

.nav-language {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid var(--primary-border-alpha);
  flex-shrink: 0;
  position: relative;
}

.nav-language:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.nav-language::before {
  content: "🌍";
  font-size: 20px;
}

/* Login and Logout buttons with language globe styling */
#loginBtn, #logoutBtn {
  background: var(--primary-light);
  border: 2px solid var(--primary-border-alpha);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

#loginBtn:hover, #logoutBtn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
  color: var(--text-primary);
}

/* Sign Up button with login hover state styling */
#signupBtn {
  background: var(--primary-hover) !important;
  border: 2px solid var(--primary-border-alpha) !important;
  color: var(--text-primary) !important;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

#signupBtn:hover {
  background: var(--primary-accent) !important;
  transform: scale(1.05);
  color: var(--text-primary) !important;
}

/* User authentication info */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-email {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* Above-the-fold background wrapper */
.above-fold-wrapper {
  position: relative;
  min-height: 100vh;
  margin: -20px -20px 0 -20px;
  padding: 20px 20px 80px 20px; /* Reduced bottom padding for footer */
  background: 
    linear-gradient(var(--overlay-white), var(--overlay-white)),
    url('/public/images/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Page wrapper for other pages (worksheets, account, pricing) */
.page-wrapper {
  position: relative;
  min-height: 100vh;
  margin: -20px -20px 0 -20px;
  padding: 20px 20px 20px 20px; /* Reduced bottom padding for footer */
  background: 
    linear-gradient(var(--overlay-white), var(--overlay-white)),
    url('/public/images/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Footer Styles */
.site-footer {
  background: var(--primary-color);
  padding: 30px 0; /* Remove horizontal padding to extend full width */
  position: relative;
  z-index: 10;
  width: 100vw; /* Full viewport width */
  margin-left: calc(-50vw + 50%); /* Center and extend full width */
  margin-right: calc(-50vw + 50%);
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px; /* Add padding back for content spacing */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  text-align: center;
}

.footer-item {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: var(--primary-stroke);
  text-decoration: underline;
}

/* Mobile footer styling */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .footer-item {
    font-size: 0.8rem;
  }
}

.hero-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 10px 40px 10px; /* Reduced side padding for headline */
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.1;
  margin-left: 10px;
  margin-right: 10px;
}

.hero-title .highlight {
  color: var(--primary-color);
  font-weight: 800;
  -webkit-text-stroke: 2px var(--primary-stroke);
  text-stroke: 2px var(--primary-stroke);
  font-size: 1.1em;
}

.hero-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--text-alpha);
  margin-bottom: 20px;
  max-width: 740px;
  line-height: 1.6;
  margin-left: 60px;
  margin-right: 60px;
}

.form-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.form-shadow {
  position: absolute;
  top: 8px;
  left: 8px;
  right: -8px;
  bottom: -8px;
  background: var(--primary-color);
  border-radius: 20px;
  z-index: 1;
}

.generate-form {
  background: white;
  border: 4px solid var(--primary-border);
  border-radius: 20px;
  padding: 60px 40px 60px 40px;
  position: relative;
  z-index: 2;
}

.generate-form::before {
  content: '';
  position: absolute;
  top: clamp(-15px, -2.5vw, -25px);
  left: clamp(10%, 25vw, 25%);
  right: clamp(10%, 25vw, 25%);
  height: clamp(30px, 5vw, 40px);
  background: 
    url('/public/images/notebook-ring.png') 0% center no-repeat,
    url('/public/images/notebook-ring.png') 12.5% center no-repeat,
    url('/public/images/notebook-ring.png') 25% center no-repeat,
    url('/public/images/notebook-ring.png') 37.5% center no-repeat,
    url('/public/images/notebook-ring.png') 50% center no-repeat,
    url('/public/images/notebook-ring.png') 62.5% center no-repeat,
    url('/public/images/notebook-ring.png') 75% center no-repeat,
    url('/public/images/notebook-ring.png') 87.5% center no-repeat,
    url('/public/images/notebook-ring.png') 100% center no-repeat;
  background-size: clamp(25px, 4vw, 40px) clamp(25px, 4vw, 40px);
  z-index: 3;
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: end;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
}

/* Only apply min-width to keyword field that should grow */
.form-group:first-child {
  min-width: 200px;
}

/* Add consistent gaps between form fields */
.form-group:not(:last-child) {
  margin-right: 8px; /* reduced by 50% (was 16px) */
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.keyword-input {
  width: 100%;
  padding: 18px 24px;
  border: 3px solid var(--primary-border);
  border-radius: 16px;
  font-size: 17px;
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease;
  background: white;
  box-shadow: 0 2px 8px var(--primary-glow);
  color: var(--text-primary);
}

.keyword-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--primary-lighter);
  box-shadow: 0 4px 12px var(--primary-glow-strong);
  transform: translateY(-1px);
}

.keyword-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.keyword-input:hover {
  border-color: var(--primary-color);
  box-shadow: 0 3px 10px var(--primary-glow-hover);
}

.age-select {
  padding: 18px 24px;
  border: 3px solid var(--primary-border);
  border-radius: 16px;
  font-size: 17px;
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  background: white;
  min-width: 160px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--primary-glow);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 50px;
}

.age-select:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--primary-lighter);
  box-shadow: 0 4px 12px var(--primary-glow-strong);
  transform: translateY(-1px);
}

.age-select:hover {
  border-color: var(--primary-color);
  box-shadow: 0 3px 10px var(--primary-glow-hover);
}

/* Child name field styling (match keyword/age styles) */
.child-name-input,
.child-name-select {
  width: 154px; /* wider by 10% (140px + 14px = 154px) */
  padding: 18px 24px;
  border: 3px solid var(--primary-border);
  border-radius: 16px;
  font-size: 17px;
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
  background: white;
  color: var(--text-primary);
  appearance: none;
}

.child-name-select {
  cursor: pointer;
  /* same caret as age dropdown */
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 50px;
}

.child-name-input:focus,
.child-name-select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--primary-lighter);
  box-shadow: 0 4px 12px var(--primary-glow-strong);
  transform: translateY(-1px);
}

.child-name-input:hover,
.child-name-select:hover {
  border-color: var(--primary-color);
  box-shadow: 0 3px 10px var(--primary-glow-hover);
}

.child-name-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

.generate-btn {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  background: var(--secondary-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  box-shadow: 0 4px 12px var(--secondary-alpha);
}

.generate-btn::before {
  content: '';
  width: 80px;
  height: 80px;
  background: url('/public/images/pencil-icon.png') center center no-repeat;
  background-size: contain;
  transition: transform 0.3s ease;
}

.generate-btn:hover {
  transform: translateX(-50%) scale(1.05);
}

.generate-btn:hover::before {
  transform: rotate(15deg);
}

.generate-btn:active::before,
.generate-btn.spinning::before {
  animation: pencil-spin 0.4s ease-in-out;
}

@keyframes pencil-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(1440deg); }
}

.btn-indicator {
  position: absolute;
  bottom: -170px;
  left: 55%;
  transform: translateX(-140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

.arrow-icon {
  width: 56px;
  height: 56px;
  background: url('/public/images/arrow.png') center center no-repeat;
  background-size: contain;
  transform: rotate(4deg);
}

.arrow-text {
  font-family: 'Delicious Handrawn', cursive;
  font-size: 22px;
  color: var(--text-primary);
  white-space: nowrap;
  transform: rotate(4deg) translate(-120px, -30px);
}

.suggestions {
  margin-top: 30px;
}

.suggestions-title {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 900px;
  margin: 0 auto;
}

.suggestion-btn {
  background: var(--primary-color);
  border: 2px solid var(--primary-border-alpha-30);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.suggestion-btn:hover {
  background: var(--bg-warning);
  color: var(--text-primary);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
}

.status-message {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.worksheets-section {
  background: var(--primary-color);
  padding: 80px 20px;
  margin-top: 0;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  position: relative;
}

.worksheets-content {
  max-width: 1200px;
  margin: 0 auto;
}

.worksheets-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.worksheets-list {
  list-style: none;
  padding: 0;
}

.worksheet-item {
  background: var(--gray-light);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.worksheet-item:hover {
  background: var(--gray-200);
}

.worksheet-info {
  flex: 1;
}

.worksheet-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 16px;
  margin-bottom: 4px;
}

.worksheet-meta {
  color: var(--text-secondary);
  font-size: 14px;
}

.worksheet-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-preview {
  background: var(--link-special);
  color: white;
}

.btn-preview:hover {
  background: var(--link-hover);
}

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

.btn-pdf:hover {
  background: var(--success-hover);
}

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

.btn-delete:hover {
  background: var(--error-hover);
}

@media (max-width: 768px) {
  /* Enhanced mobile form layout */
  .form-container {
    margin-top: 20px;
    margin-bottom: 20px;
    width: 95%;
    max-width: none;
  }
  
  .generate-form {
    padding: 30px 20px 40px 20px;
    border-radius: 16px;
  }
  
  .form-shadow {
    border-radius: 16px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .form-group {
    width: 100% !important;
    min-width: 100% !important;
    flex: none !important;
  }
  
  /* Override inline flex styles for mobile */
  .form-row .form-group[style*="flex"] {
    flex: none !important;
    width: 100% !important;
  }
  
  /* Remove margin-right for mobile */
  .form-group:not(:last-child) {
    margin-right: 0;
  }
  
  /* Enhanced mobile input styling */
  .keyword-input,
  .child-name-input,
  .child-name-select,
  .age-select {
    width: 100% !important;
    padding: 16px 20px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 12px;
    min-height: 56px; /* Better touch target */
    box-sizing: border-box;
  }
  
  /* Mobile hero adjustments */
  .hero-title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 16px;
  }
  
  .hero-subtitle {
    font-size: 16px;
    margin-bottom: 20px;
  }
  
  .suggestion-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 40px;
  }
  
  /* Hide main form suggestion buttons on mobile, but keep babysit mode button */
  .suggestions .suggestion-btn:not(.babysit-mode-btn) {
    display: none;
  }
  
  /* Always show word buttons in babysit modal */
  .category-words .suggestion-btn.word-btn {
    display: flex !important;
  }
  
  .babysit-mode-btn {
    grid-column: span 1 !important;
    padding: 16px 20px;
    font-size: 16px;
    display: block;
  }

  .btn-indicator {
    left: 65%;
  }
  
  /* Additional adjustment for iPhone screens around 414px */
  @media (max-width: 414px) {
    .btn-indicator {
      left: 70%;
    }
    
    .arrow-icon {
      transform: rotate(-20deg);
    }
  }
  
  /* Hide moving flowers on mobile for cleaner look */
  .moving-flowers-left,
  .moving-flowers-right {
    display: none;
  }
  
  /* Enhanced mobile navigation */
  .nav-bar {
    width: 100%;
  }
  
  .nav-logo-img {
    height: 48px;
  }
  
  .nav-right {
    gap: 8px;
  }
  
  .nav-links {
    gap: 4px;
  }
  
  /* Mobile hero section improvements */
  .hero-section {
    padding: 20px 20px 60px 20px;
    text-align: center;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .hero-title {
    font-size: 32px;
  }

  .form-container {
    width: 98%;
  }
  
  .generate-form {
    padding: 20px 15px 30px 15px;
  }
  
  .keyword-input,
  .child-name-input,
  .child-name-select,
  .age-select {
    width: 100% !important;
    padding: 14px 16px;
    min-height: 52px;
    box-sizing: border-box;
  }
  
  .form-group {
    width: 100% !important;
  }
  
  /* Keep suggestion buttons hidden on small mobile */
  .suggestion-btn:not(.babysit-mode-btn) {
    display: none;
  }
  
  .nav-bar {
    padding: 0 12px;
  }
  
  .nav-logo-img {
    height: 40px;
  }
}

/* Loading Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 40px var(--overlay-medium);
  max-width: 400px;
  width: 90%;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-form);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.modal h3 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
  font-size: 20px;
}

.modal p {
  margin: 0 0 16px 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.status-step {
  background: var(--gray-light);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.status-step.active {
  background: var(--info-light);
  color: var(--info-hover);
  position: relative;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.status-step.active::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 10px;
  background: linear-gradient(45deg, var(--primary-color), var(--info-hover), var(--primary-hover), var(--info-color));
  background-size: 300% 300%;
  z-index: -1;
  animation: loading-border 2s ease-in-out infinite;
}

@keyframes loading-border {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.status-step.completed {
  background: var(--success-light);
  color: var(--success-medium);
}

.step-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.status-step .step-icon {
  background: var(--gray-subtle);
  color: var(--text-secondary);
}

.status-step.active .step-icon {
  background: var(--info-hover);
  color: white;
}

.status-step.completed .step-icon {
  background: var(--success-medium);
  color: white;
}

/* Features Section */
.features-section {
  padding: 0;
  background: var(--bg-secondary);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  position: relative;
}

.features-content {
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 600px;
}

.features-text {
  flex: 1;
  padding: 80px 60px 80px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.features-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
  text-align: left;
  line-height: 1.2;
  width: 80%;
}

.features-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--text-alpha);
  margin-bottom: 0;
  text-align: left;
  line-height: 1.6;
  max-width: 500px;
}

.features-graphic {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 40px 40px 20px;
}

.concepts-image {
  width: 100%;
  max-width: 560px;
  height: auto;
  object-fit: contain;
}

.our-story-image {
  width: 100%;
  max-width: 560px;
  height: auto;
  object-fit: contain;
}

/* Responsive adjustments for features */
@media (max-width: 768px) {
  .features-content {
    flex-direction: column;
    min-height: auto;
  }
  
  .features-text {
    padding: 60px 40px 40px 40px;
    text-align: center;
  }
  
  .features-title {
    text-align: center;
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    width: 100%;
  }
  
  .features-subtitle {
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
  }
  
  .features-graphic {
    padding: 0 20px 60px 20px;
  }
  
  .concepts-image {
    max-width: 100%;
  }
}

/* Subjects Section */
.subjects-section {
  padding: 120px 0;
  background: var(--primary-border);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  position: relative;
}

.subjects-content {
  display: flex;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  gap: 60px;
}

.subjects-buttons {
  flex: 0 0 30%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.subject-btn {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border: 2px solid var(--primary-hover);
  border-radius: 12px;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Nunito', sans-serif;
  gap: 16px;
  color: var(--text-primary);
  font-weight: 500;
}

.subject-btn.active {
  background: var(--bg-warning);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
}

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

.subject-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  flex-shrink: 0;
}

.math-symbols {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  gap: 1px;
}

.math-row {
  letter-spacing: 2px;
}

.subject-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
}

.subjects-info {
  flex: 1;
  position: relative;
  min-height: 400px;
}

.subjects-info .form-shadow {
  position: absolute;
  top: 8px;
  left: 8px;
  right: -8px;
  bottom: -8px;
  background: var(--primary-hover);
  border-radius: 20px;
  z-index: 1;
}

.subject-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
  background: white;
  border: 4px solid var(--primary-hover);
  padding: 40px;
  border-radius: 20px;
  z-index: 2;
}

.subject-content.active {
  opacity: 1;
  visibility: visible;
}

.subject-title {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.3;
}

.subject-description {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-alpha);
  line-height: 1.6;
  margin-bottom: 24px;
}

.subject-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.subject-features li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.subject-features li:before {
  content: '✓';
  background: var(--success-color);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  margin-right: 12px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Math concepts grid styling */
.math-concepts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.math-concept {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.math-concept.available {
  background: var(--success-light);
  color: var(--success-dark);
  border: 1px solid var(--success-color);
}

.math-concept.coming-soon {
  background: var(--gray-100);
  color: var(--text-secondary);
  border: 1px solid var(--gray-300);
}

/* Responsive adjustments for subjects - Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
  .subjects-content {
    flex-direction: column;
    padding: 0 30px;
    gap: 30px;
  }
  
  .subjects-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
  
  .subject-btn {
    min-width: 140px;
    padding: 16px;
  }
  
  .subjects-info {
    min-height: 350px;
  }
  
  .subject-content {
    padding: 35px;
  }
  
  .subject-title {
    font-size: 24px;
  }
  
  .subject-description {
    font-size: 15px;
  }
}

/* Responsive adjustments for subjects - Mobile */
@media (max-width: 768px) {
  .subjects-section {
    padding: 60px 0;
  }
  
  .subjects-content {
    flex-direction: column;
    padding: 0 20px;
    gap: 40px;
  }
  
  .subjects-buttons {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    justify-content: center;
  }
  
  .subject-btn {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 12px 8px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .subject-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .math-symbols {
    font-size: 8px;
    gap: 0px;
  }
  
  .math-row {
    letter-spacing: 1px;
  }
  
  .subject-label {
    font-size: 14px;
    font-weight: 600;
  }
  
  .subjects-info {
    min-height: 300px;
    position: static;
  }
  
  .subjects-info .form-shadow {
    display: none;
  }
  
  .subject-content {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 30px 20px;
    margin-bottom: 20px;
  }
  
  .subject-content:not(.active) {
    display: none;
  }
  
  .subject-title {
    font-size: 22px;
  }
  
  .subject-description {
    font-size: 15px;
  }
}

/* Story Section - Flipped layout from features */
.story-section {
  padding: 0;
  background: #fffef5; /* Light yellowish background, lighter than footer's --primary-color */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  position: relative;
}

.story-content {
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 600px;
}

.story-graphic {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 20px 40px 40px;
}

.story-text {
  flex: 1;
  padding: 80px 80px 80px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-title {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
  text-align: left;
  line-height: 1.2;
  width: 80%;
}

.story-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  font-weight: 400;
  color: var(--text-alpha);
  margin-bottom: 18px;
  text-align: left;
  line-height: 1.6;
  max-width: 500px;
}

.story-signature {
  font-family: 'Delicious Handrawn', cursive;
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  font-weight: 400;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 0;
  text-align: left;
  font-style: italic;
}

.story-highlight {
  background: linear-gradient(120deg, var(--primary-color) 0%, var(--primary-light) 100%);
  background-size: 100% 3px;
  background-repeat: no-repeat;
  background-position: 0 95%;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 2px;
  transition: all 0.3s ease;
}

.story-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid var(--secondary-color);
  transition: all 0.3s ease;
  padding-bottom: 1px;
}

.story-link:hover {
  color: var(--secondary-hover);
  border-bottom-color: var(--secondary-hover);
  transform: translateY(-1px);
}

/* Responsive adjustments for story */
@media (max-width: 768px) {
  .story-content {
    flex-direction: column;
    min-height: auto;
  }
  
  .story-graphic {
    padding: 60px 20px 40px 20px;
    order: 1;
  }
  
  .story-text {
    padding: 40px 40px 60px 40px;
    text-align: center;
    order: 2;
  }
  
  .story-title {
    text-align: center;
    font-size: clamp(1.1rem, 4.5vw, 1.6rem);
    width: 100%;
  }
  
  .story-subtitle {
    text-align: center;
    max-width: 100%;
    margin: 0 auto 20px auto;
  }
  
  .story-signature {
    text-align: center;
  }
}

/* Preview Modal Styles */
.preview-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-dark);
  backdrop-filter: blur(5px);
}

.preview-modal-content {
  background-color: white;
  margin: 3% auto;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px var(--overlay-medium);
  max-height: 90vh;
  overflow-y: auto;
}

.preview-modal-content .close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.preview-modal-content .close:hover {
  color: var(--text-primary);
}

.preview-modal-content h2 {
  margin: 0 0 20px 0;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
}

/* Keep original for backwards compatibility but add new specific class */
.preview-image {
  max-width: 100%;
  max-height: 1200px;
  border-radius: 10px;
  box-shadow: 0 10px 30px var(--overlay-subtle);
  margin: 20px auto 10px auto;
  border: 2px solid var(--gray-card);
  display: block;
}

/* Small preview image for generation modal */
.preview-image-modal {
  max-width: 145px !important;
  max-height: 350px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
  margin: 20px auto 10px auto !important;
  border: none !important;
  display: block !important;
}

.download-btn {
  background: var(--primary-color);
  border: 2px solid var(--primary-border-alpha-30);
  border-radius: 12px;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
  margin: 20px auto 10px auto;
  display: block;
  min-width: 200px;
}

.download-btn:hover {
  background: var(--bg-warning);
  color: var(--text-primary);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
}

.preview-note {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 15px;
  font-style: italic;
}

@media (max-width: 768px) {
  .preview-modal-content {
    margin: 10% auto;
    padding: 20px;
    width: 95%;
  }
  
  .preview-image {
    max-height: 900px;
  }
  
  .preview-modal-content h2 {
    font-size: 20px;
    margin-bottom: 15px;
  }
  
  .download-btn {
    font-size: 16px;
    padding: 12px 24px;
    min-width: 180px;
  }
}

/* Authentication Modal Styles */
.auth-modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-darker);
  backdrop-filter: blur(8px);
}

.auth-modal-content {
  background-color: white;
  margin: 3% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  position: relative;
  box-shadow: 0 25px 80px var(--overlay-light);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-header {
  padding: 40px 40px 20px 40px;
  text-align: center;
  border-bottom: 1px solid var(--gray-card);
}

.auth-header h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.auth-modal-content .close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s ease;
  z-index: 10;
}

.auth-modal-content .close:hover {
  color: var(--text-primary);
}

.auth-tabs {
  display: flex;
  padding: 0 40px;
  margin-top: 20px;
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: var(--gray-light);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 0 5px;
}

.auth-tab.active {
  background: var(--primary-color);
  color: var(--text-primary);
}

.google-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: calc(100% - 80px);
  margin: 30px 40px 20px 40px;
  padding: 15px 20px;
  border: 2px solid var(--border-gray);
  background: white;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.google-auth-btn:hover {
  border-color: var(--button-google);
  background: var(--bg-auth);
}

.auth-divider {
  text-align: center;
  margin: 20px 40px;
  position: relative;
  color: var(--text-muted);
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-gray);
}

.auth-divider span {
  background: white;
  padding: 0 15px;
  position: relative;
}

.auth-form {
  padding: 0 40px 30px 40px;
}

.auth-form input {
  width: 100%;
  padding: 15px 20px;
  margin-bottom: 15px;
  border: 2px solid var(--border-gray);
  border-radius: 12px;
  font-size: 16px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
  font-family: 'Nunito', sans-serif;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--link-color);
}

.auth-submit-btn {
  width: 100%;
  padding: 15px 20px;
  background: var(--primary-color);
  color: var(--text-primary);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s ease;
  font-family: 'Nunito', sans-serif;
}

.auth-submit-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.phone-step {
  padding: 20px 40px 40px 40px;
}

.phone-header {
  text-align: center;
  margin-bottom: 30px;
}

.phone-header h3 {
  margin: 0 0 10px 0;
  font-size: 24px;
  color: var(--text-primary);
}

.phone-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.skip-btn {
  width: 100%;
  padding: 12px 20px;
  margin-top: 10px;
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-gray);
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Nunito', sans-serif;
}

.skip-btn:hover {
  background: var(--gray-light);
  border-color: var(--gray-placeholder);
}

.auth-footer {
  padding: 20px 40px 30px 40px;
  text-align: center;
  border-top: 1px solid var(--gray-card);
}

.auth-footer p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-footer a {
  color: var(--primary-accent);
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Phone step styling */
.phone-step {
  padding-top: 60px;
}

.phone-step .auth-submit-btn {
  margin-top: 20px;
}

.phone-step .auth-submit-btn:disabled {
  background: var(--gray-disabled);
  cursor: not-allowed;
  transform: none;
}

/* Phone input row styling */
.phone-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.phone-input-row input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--form-border);
  border-radius: 8px;
  font-size: 16px;
  font-family: 'Nunito', system-ui, -apple-system, 'Noto Sans TC', Arial, sans-serif;
  transition: border-color 0.2s ease;
}

.phone-input-row input:focus {
  outline: none;
  border-color: var(--link-purple);
  box-shadow: 0 0 0 3px var(--form-shadow-focus);
}

.request-to-join-btn {
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.request-to-join-btn:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
}

.request-to-join-btn:disabled {
  background: var(--gray-disabled);
  cursor: not-allowed;
  transform: none;
}

/* Community Invitation Box Styling */
.community-invitation {
  background: linear-gradient(135deg, #f8f9ff 0%, #fff4e6 100%);
  border: 2px solid #e3f2fd;
  border-radius: 16px;
  padding: 24px 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.community-invitation::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 16px 16px 0 0;
}

.community-invitation h3 {
  color: #2c5aa0;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
  text-align: center;
}

.community-invitation p {
  color: #4a5568;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
  text-align: center;
}

.whatsapp-section {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  border: 1px solid #e2e8f0;
}

/* Phone Step Modal Styling */
.phone-step {
  padding: 30px;
  text-align: center;
}

/* Modal Layout - Two Column Design */
.modal-layout-container {
  display: flex;
  gap: 24px;
  margin: 20px 0;
  align-items: flex-start;
}

.modal-left-column {
  flex: 0 0 30%;
  display: flex;
  justify-content: center;
}

.modal-right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-bottom-section {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

/* Responsive adjustments for modal layout */
@media (max-width: 768px) {
  .modal-layout-container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .modal-left-column {
    flex: none;
  }
  
  .modal-right-column {
    flex: none;
  }
}

.done-indicator {
  background: var(--success-color);
  color: white;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-input-row input:disabled {
  background: var(--gray-ultralight);
  color: var(--text-secondary);
  cursor: not-allowed;
  border-color: var(--gray-300);
}

@media (max-width: 768px) {
  .auth-modal-content {
    margin: 5% auto;
    width: 95%;
  }
  
  .auth-header,
  .auth-form,
  .phone-step {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .auth-tabs {
    padding: 0 20px;
  }
  
  .google-auth-btn {
    margin-left: 20px;
    margin-right: 20px;
    width: calc(100% - 40px);
  }
  
  .auth-divider {
    margin-left: 20px;
    margin-right: 20px;
  }
  
  .auth-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Babysit Modal Overlay */
.babysit-modal-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-light);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 20px 40px var(--overlay-medium);
  max-width: 400px;
  width: 90%;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-content.babysit-modal {
  max-width: 1000px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: none;
  transform: none;
  transition: none;
}

/* Babysit Mode Styles */
.babysit-mode-btn {
  background: var(--secondary-color) !important;
  border: 2px solid var(--secondary-dark) !important;
  color: white !important;
  grid-column: span 2 !important;
  min-width: 160px !important;
  font-family: 'Nunito', system-ui, -apple-system, 'Noto Sans TC', Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.babysit-mode-btn:hover {
  background: var(--secondary-dark) !important;
  border-color: var(--secondary-darker) !important;
  transform: scale(1.02) !important;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-divider);
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Nunito', system-ui, -apple-system, 'Noto Sans TC', Arial, sans-serif;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 5px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 30px;
}

.category-tabs-container {
  margin-bottom: 25px;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.subcategory-tabs-container {
  margin-bottom: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-card);
}

.subcategory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.subcategory-tab {
  background: var(--gray-light);
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.subcategory-tab:hover {
  background: var(--border-gray);
  border-color: var(--gray-border-light);
}

.subcategory-tab.active {
  background: var(--primary-color);
  border-color: var(--primary-hover);
  color: var(--text-primary);
}

.category-tab {
  background: var(--gray-light);
  border: 2px solid var(--border-gray);
  color: var(--gray-text-input);
  padding: 12px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  line-height: 1.3;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-tab:hover {
  background: var(--border-gray);
  transform: translateY(-2px);
}

.category-tab.active {
  background: var(--primary-color);
  border-color: var(--primary-border);
  color: var(--text-primary);
}

.category-words-container {
  min-height: 200px;
  width: 100%;
  overflow-y: auto;
}

.category-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

@media (max-width: 768px) {
  .category-words-container {
    min-height: 150px;
    max-height: 300px;
  }
  
  .category-words {
    padding-bottom: 20px;
  }
}

.word-btn {
  margin: 0 !important;
  line-height: 1.3;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 16px;
}

.no-words {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 16px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  
  .modal-content.babysit-modal {
    width: 95%;
    max-height: 85vh;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .modal-body {
    padding: 15px 20px;
  }
  
  .category-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .category-tab {
    font-size: 11px;
    padding: 10px 6px;
    min-height: 40px;
  }
}

/* Toast Notification Styles */
.notification {
  position: fixed;
  top: 100px;
  right: 20px;
  background: white;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px var(--shadow-md);
  z-index: 2100;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  border-left: 4px solid var(--info-color);
  max-width: 400px;
  font-weight: 500;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-success {
  border-left-color: var(--success-color);
  color: var(--success-dark);
}

.notification-error {
  border-left-color: var(--error-color);
  color: var(--error-text);
}

.notification-info {
  border-left-color: var(--info-color);
  color: var(--info-dark);
}
