@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #1a1a1a;
  --border-hover: #2a2a2a;
  --text: #ededed;
  --text-secondary: #666666;
  --accent: #f0db4f;
  --accent-hover: #d4c240;
  --accent-dim: #f0db4f15;
  --green: #22c55e;
  --yellow: #f0db4f;
  --radius: 8px;
  --font: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem;
}

#app { width: 100%; max-width: 480px; }

header { text-align: center; padding: 1rem 0; }
.logo { font-size: 2rem; margin-bottom: 0.25rem; }
header h1 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.accent { color: var(--accent); }
.track-counter, #status-text, .tag-hint { font-family: var(--mono); }
.news-item .title { font-family: var(--font); }

.section-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.tag-hint { text-transform: none; font-size: 0.7rem; }

/* Presenters */
#presenter-selector { margin: 1rem 0; }
.presenter-options { display: flex; gap: 0.5rem; }
.presenter-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 150ms ease;
  text-align: center;
}
.presenter-card:hover { border-color: var(--border-hover); }
.presenter-card.active { border-color: var(--accent); background: var(--accent-dim); }
.presenter-card .name { font-weight: 600; font-size: 0.85rem; }
.presenter-card .desc { color: var(--text-secondary); font-size: 0.65rem; line-height: 1.3; margin-top: 0.2rem; }

/* Tags */
#tags-section { margin: 1rem 0; }
.tags-container { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}
.tag-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
  font-weight: 500;
}
.tag-chip:hover { border-color: var(--border-hover); }
.tag-chip .remove {
  font-size: 0.6rem;
  opacity: 0.5;
  margin-left: 0.2rem;
}
.tag-chip .remove:hover { opacity: 1; }

.add-tag-row { display: flex; gap: 0.4rem; }
.add-tag-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 16px;
  font-family: var(--font);
  outline: none;
}
.add-tag-row input:focus { border-color: var(--accent); }
.add-tag-row button {
  background: var(--accent);
  border: none;
  color: #0a0a0a;
  width: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

/* Player */
#player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1rem 0;
}
.now-playing { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-secondary); flex-shrink: 0; }
.status-dot.playing { background: var(--green); animation: pulse 2s infinite; }
.status-dot.loading { background: var(--yellow); animation: pulse 1s infinite; }
.status-dot.ready { background: var(--accent); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
#status-text { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
#current-title { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.75rem; line-height: 1.4; min-height: 1.4em; }
.progress-bar { width: 100%; height: 3px; background: var(--border); border-radius: 2px; margin-bottom: 1rem; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; transition: width 200ms linear; }
.controls { display: flex; justify-content: center; align-items: center; gap: 1.5rem; }
.control-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  font-size: 1.1rem; width: 42px; height: 42px; border-radius: 50%;
  cursor: pointer; transition: all 150ms ease;
  display: flex; align-items: center; justify-content: center;
}
.control-btn:hover { border-color: var(--text-secondary); background: var(--border); }
.control-btn.main { width: 52px; height: 52px; font-size: 1.3rem; background: var(--accent); border-color: var(--accent); color: #0a0a0a; }
.control-btn.main:hover { background: var(--accent-hover); }
.track-counter { text-align: center; color: var(--text-secondary); font-size: 0.7rem; margin-top: 0.75rem; }

/* News list */
#news-list { margin-bottom: 2rem; }
.news-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 0.4rem; cursor: pointer; transition: border-color 150ms ease;
}
.news-item:hover { border-color: var(--border-hover); }
.news-item.active { border-color: var(--accent); background: var(--accent-dim); }
.news-item .icon { font-size: 1.1rem; flex-shrink: 0; }
.news-item .title { flex: 1; font-size: 0.8rem; line-height: 1.3; }
.news-item .play-icon { color: var(--text-secondary); font-size: 0.8rem; flex-shrink: 0; }
.news-item.active .play-icon { color: var(--accent); }
.news-item.processing .play-icon { animation: pulse 1s infinite; color: var(--yellow); }

/* Expanded news */
#expanded-news {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
#expanded-news h2 { font-size: 1rem; margin: 0.75rem 0; line-height: 1.4; }
#expanded-content { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.6; }
.close-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 0.8rem; padding: 0; }

/* Processing overlay */
#processing-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100;
}
.processing-content { text-align: center; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
#processing-text { color: var(--text-secondary); font-size: 0.85rem; }

/* News header with time filter */
.news-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.time-filters { display: flex; gap: 0.25rem; }
.time-btn {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.65rem;
  cursor: pointer; transition: all 150ms ease; font-family: var(--mono);
}
.time-btn:hover { border-color: var(--border-hover); }
.time-btn.active { background: var(--accent); border-color: var(--accent); color: #0a0a0a; font-weight: 500; }

/* Loading message */
.loading-msg {
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 1.5rem;
  text-align: center;
  font-family: var(--mono);
}

/* Load more */
.load-more-btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 150ms ease;
  margin-top: 0.5rem;
  font-family: var(--font);
}
.load-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.load-more-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.hidden { display: none !important; }

@media (max-width: 400px) {
  .presenter-options { flex-direction: column; }
  .controls { gap: 1rem; }
}
