/* Shared Design System - English Kindergarten */

/* CSS Variables */
:root {
  --bg-gradient: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 50%, #a29bfe 100%);
  --book-bg: #fffef9;
  --book-shadow: rgba(139, 69, 19, 0.15);
  --chunk-default: #b8a898;
  --chunk-active: #d63031;
  --highlight-bg: #fff4e6;
  --accent-color: #ff6b6b;
  --button-primary: #ff7675;
  --button-secondary: #74b9ff;
  --button-success: #55efc4;
  --page-border: #e8d5c4;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Lexend", sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Decorations */
body::before {
  content: "⭐";
  position: fixed;
  top: 10%;
  left: 10%;
  font-size: 30px;
  opacity: 0.3;
  animation: twinkle 3s infinite;
  pointer-events: none;
}

body::after {
  content: "🌙";
  position: fixed;
  top: 15%;
  right: 15%;
  font-size: 35px;
  opacity: 0.3;
  animation: twinkle 4s infinite;
  pointer-events: none;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

/* Button Styles */
button, .btn {
  border: none;
  background: var(--button-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 118, 117, 0.3);
  font-family: "Lexend", sans-serif;
}

button:hover, .btn:hover {
  background: #ff5e5e;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 118, 117, 0.4);
}

button:active, .btn:active {
  transform: translateY(-1px);
}

button:disabled, .btn:disabled {
  background: #dfe6e9;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--button-secondary);
  box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

.btn-secondary:hover {
  background: #5eaaff;
  box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
}

.btn-success {
  background: var(--button-success);
  box-shadow: 0 4px 15px rgba(85, 239, 196, 0.3);
}

.btn-success:hover {
  background: #3fdfb0;
  box-shadow: 0 6px 20px rgba(85, 239, 196, 0.4);
}

button.playing {
  background: var(--button-success);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 15px rgba(85, 239, 196, 0.3); }
  50% { box-shadow: 0 4px 25px rgba(85, 239, 196, 0.6); }
}

/* Select Styles */
select {
  padding: 10px 18px;
  border-radius: 25px;
  border: 3px solid #f8e5d7;
  background: white;
  font-family: "Lexend", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

select:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 10px rgba(255, 107, 107, 0.2);
}

/* Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"] {
  padding: 12px 20px;
  border-radius: 25px;
  border: 3px solid #f8e5d7;
  background: white;
  font-family: "Lexend", sans-serif;
  font-size: 15px;
  transition: all 0.3s;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 2px 10px rgba(255, 107, 107, 0.2);
}

/* Card Styles */
.card {
  background: var(--book-bg);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 60px var(--book-shadow);
  border: 8px solid var(--page-border);
}

/* Container */
.container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Error Toast */
.error-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff7675;
  color: white;
  padding: 15px 30px;
  border-radius: 15px;
  display: none;
  z-index: 1000;
  font-weight: 600;
  box-shadow: 0 5px 20px rgba(255, 118, 117, 0.4);
}

.error-message.show {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Loading Spinner */
.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--button-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
  }

  button, .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .card {
    padding: 20px;
    border-width: 5px;
  }
}
