/* StudyLight styles */

/* 1. CSS reset and base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { min-height: 100vh; font-family: 'Segoe UI', system-ui, sans-serif; transition: background-color 0.3s ease, color 0.3s ease; }

/* 2. Dark theme variables */
body[data-theme="dark"] {
  --bg-primary: #1a0a2e;
  --bg-secondary: #2d1254;
  --text-primary: #ffffff;
  --text-secondary: #c8a8e9;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.15);
}

/* 3. Light theme variables */
body[data-theme="light"] {
  --bg-primary: #e8d5f5;
  --bg-secondary: #d4b8f0;
  --text-primary: #000000;
  --text-secondary: #4a2870;
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.7);
}

/* 4. Body background using CSS variables */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* 5. Screen layout */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* 6. Glassmorphism card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 24px;
}

/* 7. Slide transition classes */
.slide {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.slide.active {
  opacity: 1;
  transform: translateX(0);
}
.slide.exit {
  opacity: 0;
  transform: translateX(-30px);
}

/* 8. Popup overlay styling */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.popup-box {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  text-align: center;
  color: var(--text-primary);
}
.popup-box p { margin-bottom: 1.5rem; }

/* 9. Progress bar */
.progress-bar {
  width: 100%;
  max-width: 400px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-bar-fill {
  height: 100%;
  background: var(--text-secondary);
  border-radius: 8px;
  width: 0%;
  transition: width 0.4s ease;
}

/* 10. Button base styles */
button {
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 1rem;
  transition: opacity 0.2s ease;
}
button:hover { opacity: 0.8; }

/* 11. Heading styles */
h1 { color: var(--text-primary); margin-bottom: 1rem; }
h2 { color: var(--text-primary); margin-bottom: 0.75rem; }
h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }

/* Textarea */
textarea {
  outline: none;
}
textarea:focus {
  border-color: var(--text-secondary) !important;
}
textarea.placeholder-error::placeholder {
  color: #e53e3e;
}

@keyframes kokoroPulse {
  0%, 100% { width: 20%; }
  50% { width: 80%; }
}
