/* Anime Anki Generator - Fun Lavender Theme */

@import url('https://fonts.googleapis.com/css2?family=Varela+Round&display=swap');

:root {
  /* Primary palette - vibrant lavender (matching flashcards) */
  --primary: #6750a4;
  --primary-dark: #4a3880;
  --primary-light: #e8def8;
  --primary-glow: rgba(103, 80, 164, 0.25);

  /* Accent - teal (matching flashcard anime highlights) */
  --accent: #00897b;
  --accent-light: #b2dfdb;

  /* Background gradient colors - bright lavender */
  --cream: #f3edf7;
  --pink-light: #e8def8;
  --lavender-light: #d0bcff;
  --pink: #d0bcff;
  --lavender: #b69df0;
  --mint: #b2dfdb;

  /* Base */
  --bg: #f3edf7;
  --card-bg: #fffbfe;
  --border: #b69df0;
  --text: #1d1b20;
  --text-muted: #6b6b6b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Varela Round', -apple-system, sans-serif;
  background: linear-gradient(180deg, var(--cream) 0%, var(--pink-light) 50%, var(--lavender-light) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  color: var(--text);
  line-height: 1.6;
}

/* Decorative background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, var(--lavender) 0%, transparent 12%),
    radial-gradient(circle at 80% 20%, var(--lavender) 0%, transparent 10%),
    radial-gradient(circle at 40% 40%, var(--mint) 0%, transparent 6%),
    radial-gradient(circle at 90% 90%, var(--pink) 0%, transparent 8%);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
}

.logo-link,
.logo-link:hover,
.logo-link:visited {
  text-decoration: none !important;
  color: inherit;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -1px;
  color: var(--primary-dark);
}

.logo::before {
  content: '🌸 ';
}

.logo::after {
  content: ' 🌸';
}

.tagline {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
}

.about-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px dashed var(--primary);
  transition: all 0.2s ease;
}

.about-link:hover {
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px var(--primary-glow), 0 8px 32px rgba(103, 80, 164, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--lavender) 100%);
  border-radius: 16px 16px 0 0;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: '🌸';
}

/* Form elements */
label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: all 0.2s ease;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-row > div {
  flex: 1;
}

.form-group {
  margin-bottom: 15px;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c5dbd 100%);
  color: white;
  width: 100%;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--text);
}

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

/* Search result */
.search-result {
  padding: 14px 18px;
  border-radius: 12px;
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-result.found {
  background: var(--accent-light);
  border: 2px solid var(--accent);
}

.search-result.not-found {
  background: var(--primary-light);
  border: 2px solid var(--lavender);
}

.search-result .icon {
  font-size: 1.4rem;
}

.search-result .details {
  flex: 1;
}

.search-result .anime-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.search-result .source {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.not-found-reasons {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0;
  padding-left: 20px;
}

.not-found-reasons li {
  margin: 4px 0;
}

/* Progress section */
.progress-bar-container {
  background: var(--primary-light);
  border-radius: 12px;
  height: 22px;
  overflow: hidden;
  margin: 20px 0;
  border: 2px solid var(--border);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #7c5dbd 50%, var(--lavender) 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  color: var(--text);
  font-weight: 600;
}

.progress-status {
  text-align: center;
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 0.9rem;
}

/* Status icons */
.status-icon {
  display: inline-block;
  margin-right: 8px;
}

.status-icon.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Download section */
.download-section {
  text-align: center;
  padding: 20px;
}

.download-section h2 {
  color: var(--text);
  margin-bottom: 10px;
}

.download-section p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn-download {
  background: linear-gradient(135deg, var(--accent) 0%, #26a69a 100%);
  color: white;
  font-size: 1.05rem;
  padding: 16px 32px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 137, 123, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 137, 123, 0.4);
}

/* Success animation */
.success-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  animation: bounce 0.6s ease;
}

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

/* Error state */
.error-message {
  background: #fff0f0;
  color: #c92a2a;
  padding: 14px 18px;
  border-radius: 10px;
  margin-top: 15px;
  font-weight: 500;
  border: 1.5px solid #ffcdd2;
}

/* Decorative elements */
.decoration {
  position: fixed;
  font-size: 2rem;
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
  animation: float 6s ease-in-out infinite;
}

.decoration.top-left {
  top: 30px;
  left: 30px;
}

.decoration.top-right {
  top: 30px;
  right: 30px;
  animation-delay: 1.5s;
}

.decoration.bottom-left {
  bottom: 30px;
  left: 30px;
  animation-delay: 4.5s;
}

.decoration.bottom-right {
  bottom: 30px;
  right: 30px;
  animation-delay: 3s;
}

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

/* Responsive */
@media (max-width: 500px) {
  body {
    padding: 15px;
  }

  .card {
    padding: 20px;
  }

  .card:hover {
    transform: none;
  }

  .logo {
    font-size: 1.8rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-download:hover {
    transform: none;
  }
}

/* Loading dots animation */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Search status */
.search-status {
  text-align: center;
  padding: 15px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Advanced options toggle */
.advanced-toggle {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 10px 0;
  margin-bottom: 5px;
  user-select: none;
  transition: color 0.2s ease;
}

.advanced-toggle:hover {
  color: var(--primary);
}

.advanced-toggle span {
  display: inline-block;
  font-size: 0.7rem;
  margin-right: 6px;
  transition: transform 0.2s ease;
}

.advanced-options {
  padding: 15px;
  background: var(--primary-light);
  border-radius: 10px;
  margin-bottom: 15px;
}

.advanced-options .form-group {
  margin-bottom: 0;
}

.field-hint {
  margin: 8px 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.history-hint {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: var(--text);
}

.history-hint a {
  color: var(--primary-dark);
  font-weight: 600;
}

/* Rate limit section */
.rate-limit-content,
.paused-content {
  text-align: center;
  padding: 20px 0;
}

.limit-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.rate-limit-content h2,
.paused-content h2 {
  margin-bottom: 10px;
  color: var(--text);
}

.rate-limit-content p,
.paused-content p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.reset-time {
  font-weight: 600;
  color: var(--text);
}

/* Email signup */
.email-signup {
  margin-top: 20px;
  padding: 15px;
  background: var(--primary-light);
  border-radius: 10px;
}

.email-signup p {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.email-form {
  display: flex;
  gap: 10px;
}

.email-form input {
  flex: 1;
  padding: 10px 14px;
}

.email-status, .feedback-status {
  margin-top: 10px;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 8px;
}

.email-status.success, .feedback-status.success {
  background: var(--accent-light);
  color: #087f5b;
}

.email-status.error, .feedback-status.error {
  background: #fff0f0;
  color: #c92a2a;
}

/* Email delivery option in progress section */
.email-delivery {
  margin: 20px 0 0 0;
  padding: 14px 16px;
  background: var(--primary-light);
  border: 2px solid var(--border);
  border-radius: 12px;
}

.email-delivery p {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: var(--text);
  text-align: center;
}

.email-delivery .email-form {
  display: flex;
  gap: 10px;
}

.email-delivery .email-form input {
  flex: 1;
}

.email-delivery .email-form button {
  white-space: nowrap;
}

/* Usage warning in download section */
.usage-warning {
  margin-top: 20px;
  padding: 12px 16px;
  background: #fff8e1;
  border-radius: 10px;
  font-size: 0.9rem;
  border: 1.5px solid #ffe082;
}

.usage-warning p {
  margin: 0;
}

.warning-urgent {
  color: #c92a2a;
  font-weight: 600;
}

.warning-caution {
  color: #e67700;
  font-weight: 500;
}

.email-signup-inline {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.email-signup-inline input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* Small button variant */
.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Feedback trigger */
.feedback-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c5dbd 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: all 0.2s ease;
  z-index: 100;
}

.feedback-trigger:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* Feedback panel */
.feedback-panel {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 300px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 24px var(--primary-glow);
  padding: 18px;
  z-index: 101;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}

.feedback-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
  line-height: 1;
}

.feedback-close:hover {
  color: var(--primary-dark);
}

.feedback-panel textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 12px;
}

.feedback-panel textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.feedback-panel .btn-primary {
  width: 100%;
}

/* About modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(55, 53, 47, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 16px 48px var(--primary-glow);
}

.modal-content::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--lavender) 100%);
  border-radius: 16px 16px 0 0;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
}

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

.modal-content h2 {
  color: var(--text);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.modal-content h3 {
  color: var(--text);
  margin: 20px 0 10px;
  font-size: 1rem;
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal-content ul {
  margin: 0 0 15px 0;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-content li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.modal-content li::marker {
  color: var(--primary);
}

.modal-content .limitations li {
  color: var(--text);
}

.modal-content a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px dashed var(--primary);
}

.modal-content a:hover {
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.about-footer {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

/* Hidden utility */
.hidden {
  display: none !important;
}
