/* style.css */
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #2c3e50;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  width: 100%;
  min-height: 60px;
  margin-bottom: 20px;
}

.menu {
  width: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.menu-rect {
  display: none;
  position: absolute;
  top: 35px;
  left: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 16px 24px;
  z-index: 10;
  min-width: 180px;
}

.menu:hover .menu-rect {
  display: block;
}

.menu-rect a {
  display: block;
  padding: 8px 0;
  color: #2c3e50;
  text-decoration: none;
  font-size: 1.1em;
}

.menu-rect a:hover {
  color: #3498db;
}

.header-title-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.title {
  font-size: 2.5em;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
  text-align: center;
}

.tagline {
  font-size: 0.9em;
  color: #7f8c8d;
  margin: 5px 0 0 0;
  text-align: center;
  font-weight: 400;
  font-style: italic;
}

/* ── Theme card ─────────────────────────────────────────────────────────────── */
.theme-section {
  margin-bottom: 30px;
}

.theme-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}

.theme-heading {
  font-size: 1.8em;
  margin: 0 0 12px 0;
  font-weight: 600;
}

.theme-description {
  font-size: 1.1em;
  line-height: 1.6;
  margin: 0 0 20px 0;
  opacity: 0.95;
}

.theme-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

/* Unified countdown */
.unified-countdown {
  background: linear-gradient(135deg, rgba(0,229,255,0.15), rgba(0,229,255,0.15));
  padding: 16px 24px;
  border-radius: 16px;
  border: 2px solid rgba(0,229,255,0.4);
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,229,255,0.2);
}

.countdown-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.countdown-main i {
  font-size: 1.8em;
  color: #00e5ff;
  animation: pulse 2s infinite;
}

#countdown {
  font-size: 2.2em;
  font-weight: 800;
  color: #00e5ff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  background: rgba(0,229,255,0.2);
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid rgba(0,229,255,0.5);
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  animation: brightGlow 2s infinite alternate;
}

@keyframes brightGlow {
  0%   { box-shadow: 0 0 8px  rgba(0,229,255,0.5); }
  100% { box-shadow: 0 0 20px rgba(0,229,255,0.8); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

.countdown-label {
  font-size: 1.1em;
  font-weight: 600;
  color: #00e5ff;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats {
  font-size: 1em;
  opacity: 0.9;
}

/* ── Action buttons ─────────────────────────────────────────────────────────── */
.actions-section {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.drop-sound-btn, .upload-btn, .link-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.drop-sound-btn:hover, .upload-btn:hover, .link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,107,107,0.3);
}

/* ── Recording / Link panels ────────────────────────────────────────────────── */
.recording-section {
  margin-bottom: 30px;
}

.recorder-card {
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}

.recorder-card h3 {
  color: #2c3e50;
  margin: 0 0 20px 0;
  font-size: 1.2em;
}

.recorder-controls {
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  background: rgba(255,68,68,0.06);
  border: 2px solid rgba(255,68,68,0.3);
  border-radius: 16px;
  padding: 16px 24px;
}

.recording-live-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff4444;
  display: inline-block;
  animation: blink 1s infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.recording-time {
  font-size: 2em;
  font-weight: 700;
  color: #ff4444;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.stop-btn {
  background: #2c3e50;
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 25px;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.stop-btn:hover { background: #e74c3c; }

.recording-context textarea,
.recorder-card textarea {
  width: 100%;
  max-width: 500px;
  height: 80px;
  padding: 15px;
  border: 2px solid #e0e6ed;
  border-radius: 12px;
  font-size: 1em;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.recording-context textarea:focus,
.recorder-card textarea:focus {
  outline: none;
  border-color: #9b59b6;
}

.audio-preview {
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #3498db;
}

.recording-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 15px;
}

.retake-btn {
  background: linear-gradient(135deg, #e17055, #d63031);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.retake-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(225,112,85,0.3);
}

.share-drop-btn {
  background: linear-gradient(135deg, #00b894, #00a085);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-drop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,184,148,0.3);
}

.btn-cancel-text {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.9em;
  cursor: pointer;
  margin-top: 10px;
  padding: 4px 0;
  display: inline-block;
}

.btn-cancel-text:hover { color: #666; }

/* Link input group */
.link-input-group {
  margin-bottom: 15px;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.link-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

.link-input-group input[type="url"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  font-size: 1em;
  margin-bottom: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.link-input-group input[type="url"]:focus {
  outline: none;
  border-color: #9b59b6;
}

.supported-platforms {
  color: #7f8c8d;
  font-style: italic;
}

/* ── Filter tags ─────────────────────────────────────────────────────────────── */
.filter-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-tag {
  background: white;
  border: 2px solid #e0e6ed;
  color: #2c3e50;
  padding: 8px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95em;
  font-family: inherit;
}

.filter-tag.active, .filter-tag:hover {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

/* ── Drops grid ──────────────────────────────────────────────────────────────── */
.sound-drops {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

/* ── Drop cards (generated by script.js) ─────────────────────────────────────── */
.drop-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.drop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.drop-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.type-badge {
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 9px;
  border-radius: 6px;
}

.type-recorded { background: #ffeef0; color: #e74c3c; }
.type-uploaded  { background: #eef0ff; color: #2d1b69; }
.type-link      { background: #effffd; color: #11998e; }

.drop-time {
  font-size: 0.8em;
  color: #aaa;
  margin-left: auto;
}

.drop-theme {
  font-size: 0.82em;
  color: #aaa;
  margin-bottom: 8px;
}

.drop-context {
  color: #34495e;
  font-style: italic;
  margin: 10px 0;
  line-height: 1.5;
  font-size: 0.95em;
}

.drop-audio {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
}

.drop-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #effffd;
  color: #11998e;
  border: 1px solid #11998e;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.88em;
  text-decoration: none;
  margin-bottom: 12px;
  font-weight: 500;
}

.drop-link-btn:hover { background: #d4faf5; }

.drop-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f5f5f5;
}

.btn-applaud {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.88em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #777;
  transition: all 0.2s;
  font-weight: 500;
  font-family: inherit;
}

.btn-applaud:hover, .btn-applaud.applauded {
  background: #fff8e1;
  border-color: #f39c12;
  color: #f39c12;
}

.btn-comment-toggle {
  background: none;
  border: none;
  color: #aaa;
  font-size: 0.88em;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  font-family: inherit;
}

.btn-comment-toggle:hover { color: #2d1b69; }

/* Comments */
.comments-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
}

.comment-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 8px;
  font-size: 0.88em;
  color: #555;
  line-height: 1.4;
}

.comment-author {
  font-weight: 600;
  color: #2d1b69;
  font-size: 0.82em;
  margin-bottom: 3px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.comment-input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.88em;
  font-family: inherit;
}

.comment-input:focus { outline: none; border-color: #2d1b69; }

.btn-comment-submit {
  background: #2d1b69;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-comment-submit:hover { background: #1a0f3d; }

/* ── Audio loading placeholder (cache hit, server fetch pending) ─────────────── */
.audio-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa;
  font-size: 0.85em;
  padding: 10px 0;
  font-style: italic;
}

/* ── Audio format unsupported (e.g. WebM on iOS Safari) ─────────────────────── */
.audio-unsupported {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85em;
  color: #795548;
}

.audio-unsupported i {
  color: #f9a825;
}

.btn-download-audio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: #6c63ff;
  color: #fff;
  border-radius: 20px;
  font-size: 0.85em;
  text-decoration: none;
  margin-left: auto;
}

.btn-download-audio:hover {
  background: #574fd6;
}

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #7f8c8d;
  grid-column: 1 / -1;
}

.empty-state i { font-size: 2.8em; display: block; margin-bottom: 14px; opacity: 0.4; }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2c3e50;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9999;
  animation: slideUp 0.25s ease;
  font-family: inherit;
}

.toast.success { background: #27ae60; }
.toast.error   { background: #e74c3c; }

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .theme-stats {
    flex-direction: column;
    text-align: center;
  }

  .actions-section {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .drop-sound-btn, .upload-btn, .link-btn {
    width: 100%;
    max-width: 280px;
    padding: 18px 30px;
    font-size: 1.2em;
  }

  .sound-drops {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .filter-tags {
    justify-content: center;
    gap: 8px;
  }

  .filter-tag {
    padding: 10px 16px;
    font-size: 0.9em;
  }
}
