/* ═══════════════════════════════════════════
   components.css — UI Components
   Protocolo Gatirena warm pink style
   ═══════════════════════════════════════════ */

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: none; border-radius: var(--radius-btn);
  background: var(--accent-gradient); color: #fff;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: var(--glow-primary);
  transition: all 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.22) 0%, transparent 55%);
  border-radius: inherit;
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--glow-secondary); }
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: 2px solid var(--border-subtle); border-radius: var(--radius-btn);
  background: rgba(255,255,255,0.6); color: var(--text-muted);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(4px);
  transition: all var(--transition-base); width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { background: rgba(255,255,255,0.9); border-color: var(--pink-400); color: var(--pink-600); }

.btn-group { display: flex; gap: 10px; }

/* ── Capture Buttons ── */
.btn-capture {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 28px 20px; width: 100%;
  background: rgba(255,255,255,0.5); border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-card); cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}
.btn-capture:hover { background: rgba(255,255,255,0.8); border-color: var(--pink-400); }
.btn-capture .capture-icon { font-size: 32px; }

/* Dual capture options (camera + gallery) */
.capture-btn-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 12px;
}
.btn-capture-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 18px 12px;
  background: rgba(255,255,255,0.5); border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-card); cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  -webkit-tap-highlight-color: transparent;
}
.btn-capture-opt:hover, .btn-capture-opt:active {
  background: rgba(255,255,255,0.8); border-color: var(--pink-400);
  transform: translateY(-2px); box-shadow: 0 4px 16px rgba(255,107,138,0.12);
}
.btn-capture-opt .capture-icon { font-size: 28px; }
.capture-hint {
  font-size: 10px; color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── Challenge Cards ── */
.challenge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 28px 22px;
  margin-bottom: 20px;
  box-shadow: var(--glow-card);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.challenge-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent-gradient); opacity: 0.6;
}
.challenge-card:hover { box-shadow: 0 8px 32px rgba(255,107,138,0.15); }
.challenge-card.locked { opacity: 0.45; pointer-events: none; filter: grayscale(0.3); }
.challenge-card.completed::before { background: linear-gradient(135deg, #6ee7b7, #34d399); opacity: 0.8; }

/* ── Badge (nerd terminal style) ── */
.badge-nerd {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--pink-500);
  background: rgba(255,107,138,0.08);
  border: 1px solid rgba(255,107,138,0.15);
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.badge-nerd.completed {
  color: #059669; background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2);
}
.badge-nerd.skipped {
  color: #d97706; background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2);
}

/* ── Chapter Number ── */
.chapter-number {
  font-family: var(--font-display); font-size: 72px; font-weight: 700;
  color: rgba(255,107,138,0.12); line-height: 1;
  margin: -10px 0 -4px; user-select: none;
}

/* ── Chapter Title ── */
.chapter-title {
  font-size: 22px; margin-bottom: 4px;
}
.chapter-subtitle {
  font-size: 14px; color: var(--text-muted); font-weight: 500;
}

/* ── Narrative (italic blockquote feel) ── */
.chapter-narrative {
  font-style: italic; color: var(--text-body);
  font-size: 15px; line-height: 1.7;
  padding: 16px 18px; margin-bottom: 4px;
  background: rgba(255,107,138,0.04);
  border-left: 3px solid var(--pink-400);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Input Fields ── */
.input-group { margin-bottom: 18px; }
.input-label {
  display: block; font-size: 14px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 8px;
  line-height: 1.4;
}
.input-field {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.7); border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm); color: var(--text-body);
  font-family: var(--font-body); font-size: 15px;
  outline: none; resize: vertical;
  transition: var(--transition-base);
  backdrop-filter: blur(4px);
}
.input-field:focus { border-color: var(--pink-500); box-shadow: 0 0 0 3px rgba(255,107,138,0.1); background: #fff; }
.input-field::placeholder { color: var(--text-dim); }

/* ── Slider ── */
.slider-container { padding: 8px 0; }
.slider-label {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 13px;
  margin-bottom: 8px;
}
.slider-value { font-size: 20px; font-weight: 700; color: var(--pink-600); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: linear-gradient(90deg, var(--pink-400), var(--pink-600));
  border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px;
  background: var(--pink-600); border-radius: 50%;
  box-shadow: 0 2px 8px rgba(255,77,109,0.4);
  cursor: pointer;
}

/* ── Progress Bar ── */
.progress-container {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253,242,248,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 10px 20px; border-bottom: 1px solid var(--border-subtle);
}
.progress-info {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px;
}
.progress-track {
  width: 100%; height: 5px;
  background: rgba(255,107,138,0.12); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: var(--accent-gradient);
  transition: width 0.6s var(--ease);
}

/* ── Day Header ── */
.day-header {
  text-align: center; padding: 32px 0 16px;
}
.day-header h2 { font-size: 28px; margin-bottom: 4px; }
.day-date {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-dim);
}

/* ── Audio Components ── */
.audio-capture-wrapper { margin-bottom: 12px; }
.audio-recorder {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px; background: rgba(255,255,255,0.5);
  border: 2px dashed var(--border-subtle); border-radius: var(--radius-card);
}
.record-timer {
  font-family: var(--font-mono); font-size: 24px; font-weight: 700;
  color: var(--text-primary);
}
.record-btn {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--accent-gradient); cursor: pointer;
  box-shadow: var(--glow-primary); position: relative;
  transition: all var(--transition-base);
}
.record-btn::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%);
  transition: all 0.2s ease;
}
.record-btn.recording::after { border-radius: 3px; width: 16px; height: 16px; }
.record-btn.recording { animation: recordPulse 1.2s ease-in-out infinite; }
@keyframes recordPulse {
  0%, 100% { box-shadow: var(--glow-primary); }
  50% { box-shadow: var(--glow-secondary); }
}

/* ── Audio Player ── */
.audio-player {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(255,255,255,0.6);
  border-radius: var(--radius-btn); border: 1px solid var(--border-subtle);
}
.play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); border: none;
  color: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; flex-shrink: 0;
}
.play-btn:hover { transform: scale(1.08); }

.waveform-bar {
  display: flex; gap: 3px; align-items: center; flex: 1; height: 24px;
}
.waveform-bar span {
  flex: 1; height: 4px; border-radius: 2px;
  background: rgba(255,107,138,0.25);
  transition: height 0.15s ease;
}
.waveform-bar.active span {
  animation: waveAnim 0.6s ease-in-out infinite alternate;
  background: var(--pink-500);
}
.waveform-bar.active span:nth-child(odd) { animation-delay: 0.1s; }
.waveform-bar.active span:nth-child(3n) { animation-delay: 0.2s; }
@keyframes waveAnim {
  0% { height: 4px; }
  100% { height: 20px; }
}

.duration {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Photo Grid ── */
.photo-upload-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px; margin-top: 12px;
}
.photo-upload-item {
  border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 1; cursor: pointer;
}
.photo-upload-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.photo-upload-item:hover img { transform: scale(1.05); }

/* ── Media Preview ── */
.media-preview {
  margin-top: 12px; border-radius: var(--radius-card); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
}
.media-preview img, .media-preview video {
  width: 100%; max-height: 400px; object-fit: contain;
}
.media-preview-actions {
  display: flex; gap: 10px; padding: 12px;
}

/* ── Quiz ── */
.quiz-question { margin-bottom: 20px; }
.question-text {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 10px; line-height: 1.5;
}
.quiz-options { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-option {
  padding: 10px 18px; border-radius: var(--radius-btn);
  background: rgba(255,255,255,0.6); border: 2px solid var(--border-subtle);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition-base);
}
.quiz-option:hover { border-color: var(--pink-400); color: var(--pink-600); }
.quiz-option.selected {
  background: var(--accent-gradient); border-color: var(--pink-600);
  color: #fff; box-shadow: var(--glow-primary);
}

.quiz-score {
  font-family: var(--font-display); font-size: 48px; font-weight: 700;
  color: var(--pink-600); text-align: center;
}
.quiz-message {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-muted);
  text-align: center; margin-bottom: 16px;
}
.quiz-results { text-align: center; }

/* ── Reveal Container ── */
.reveal-container {
  text-align: center; margin-top: 20px;
  padding: 16px; background: rgba(255,107,138,0.04);
  border-radius: var(--radius-sm);
}
.reveal-text { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }

/* ── Toast / Notification ── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  z-index: 200; padding: 12px 24px;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  max-width: 90%; display: none;
}
.toast.show {
  display: block;
  animation: toastIn 0.3s var(--ease) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast.fade-out { animation: toastOut 0.3s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(20px); } }

/* ── Loading Spinner ── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--pink-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(253,242,248,0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: none; justify-content: center; gap: 0;
  padding: 6px 0; padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.bottom-nav.visible { display: flex; }
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 32px; border: none; background: none;
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  color: var(--text-dim); cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn .nav-icon { font-size: 20px; }
.nav-btn.active { color: var(--pink-600); }
.nav-btn:hover { color: var(--pink-500); }

/* ── Modal Overlay ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
  max-width: 95vw; max-height: 90vh;
  animation: popIn 0.4s var(--ease) both;
}
@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-content img { border-radius: var(--radius-sm); max-height: 85vh; object-fit: contain; }
.modal-content video { border-radius: var(--radius-sm); max-height: 85vh; width: 100%; }

/* ── Modal Close Button ── */
.modal-close {
  position: fixed; top: 16px; right: 16px; z-index: 510;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.modal-close:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); }

/* ── Pulse Glow (Easter Egg) ── */
.pulse-glow {
  animation: pulseGlow 0.8s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
  from { text-shadow: 0 0 4px rgba(255,77,109,0.4); }
  to { text-shadow: 0 0 16px rgba(255,77,109,0.8), 0 0 32px rgba(255,107,138,0.4); }
}

/* ── Volume Controls ── */
.song-volume-btn {
  background: none; border: none; font-size: 18px;
  cursor: pointer; padding: 4px; flex-shrink: 0;
  transition: transform 0.2s ease;
}
.song-volume-btn:hover { transform: scale(1.15); }
.song-volume-slider {
  width: 60px; height: 4px !important;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,107,138,0.2) !important;
  border-radius: 2px; flex-shrink: 0;
}
.song-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  background: var(--pink-500); border-radius: 50%;
  box-shadow: 0 1px 4px rgba(255,77,109,0.3);
  cursor: pointer;
}

/* ── Song Player Card ── */
.song-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin: 16px 0;
  background: linear-gradient(135deg, rgba(255,107,138,0.08), rgba(255,77,109,0.04));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  position: relative; overflow: hidden;
}
.song-vinyl {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #2d1b32, #4a1942, #2d1b32);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}
.song-vinyl.spinning { animation: vinylSpin 2s linear infinite; }
@keyframes vinylSpin { to { transform: rotate(360deg); } }
.vinyl-inner {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--pink-500); display: flex;
  align-items: center; justify-content: center;
  font-size: 10px;
}
.song-info {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
}
.song-label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em;
}
.song-title-text {
  font-family: var(--font-sig); font-size: 1.6rem;
  color: var(--text-primary); line-height: 1.2;
}
.song-artist {
  font-size: 12px; color: var(--text-muted);
}
.song-play-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-gradient); border: none;
  color: #fff; font-size: 18px; cursor: pointer;
  box-shadow: var(--glow-primary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.song-play-btn:hover { transform: scale(1.08); }
.song-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: rgba(255,107,138,0.12);
}
.song-progress-fill {
  height: 100%; width: 0%;
  background: var(--accent-gradient);
  transition: width 0.3s linear;
}

/* ── Polaroid Frame (Protocolo Gatirena style) ── */
.polaroid-gallery {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 16px;
}
.polaroid-frame {
  background: #fff;
  padding: 12px 12px 8px;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  transform: rotate(-1.5deg);
  transition: transform 0.4s var(--ease), box-shadow 0.3s ease;
  cursor: pointer;
}
.polaroid-frame:nth-child(even) { transform: rotate(1.5deg); }
.polaroid-frame:nth-child(3n) { transform: rotate(-0.5deg); }
.polaroid-frame:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: 0 12px 40px rgba(255,107,138,0.15), 0 4px 12px rgba(0,0,0,0.06);
}
.polaroid-inner { text-align: center; }
.polaroid-photo-wrap {
  overflow: hidden; border-radius: 2px;
  background: linear-gradient(160deg, #fdf2f8, #fbcfe8);
  position: relative;
}
.polaroid-photo-wrap img {
  width: 100%; display: block;
  aspect-ratio: 4/3; object-fit: cover;
}
.polaroid-bottom {
  padding: 10px 4px 4px;
  display: flex; flex-direction: column; align-items: center;
}
.polaroid-caption {
  font-family: var(--font-sig);
  font-size: 1.4rem; color: #5a1832;
  line-height: 1.2;
}
.polaroid-date-text {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 0.08em; margin-top: 2px;
}
.polaroid-status {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-dim);
  margin-top: 4px;
}
.polaroid-status.success { color: #059669; }
.polaroid-status.error { color: #dc2626; }

/* Polaroid in modal */
.polaroid-modal {
  transform: rotate(0deg); max-width: 400px;
  margin: 0 auto;
}
.polaroid-modal .polaroid-photo-wrap img {
  aspect-ratio: auto; max-height: 60vh;
  object-fit: contain;
}
.polaroid-modal .polaroid-caption { font-size: 2rem; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .challenge-card { padding: 22px 18px; }
  .chapter-number { font-size: 56px; }
  .chapter-title { font-size: 19px; }
  .btn-primary { padding: 12px 24px; font-size: 14px; }
  .polaroid-frame { padding: 10px 10px 6px; }
  .polaroid-caption { font-size: 1.2rem; }
}
