/* ═══════════════════════════════════════════
   BOREDOM BUSTER — style.css
   Fonts: Syne 800 (headings), DM Sans (body)
   Theming via CSS custom properties
═══════════════════════════════════════════ */

/* ── Google Fonts are loaded via <link> in HTML ── */

/* ── Dark Theme (default) ── */
:root {
  --bg:           #0f0f18;
  --surface:      #1a1a2e;
  --surface2:     #232340;
  --border:       rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.22);
  --text:         #f0f0ff;
  --text2:        #b0b0d0;
  --text3:        #7070a0;
  --accent:       #7c6cfc;
  --accent2:      #e84393;
  --glow:         0 0 0 3px rgba(124,108,252,0.35);
  --pill-bg:      rgba(124,108,252,0.14);
  --pill-border:  rgba(124,108,252,0.30);
  --error:        #ff6b8a;
  --success:      #4adba2;
  --fav:          #ff8c42;
}

/* ── Light Theme ── */
[data-theme="light"] {
  --bg:           #f4f2ff;
  --surface:      #ffffff;
  --surface2:     #ededfb;
  --border:       rgba(0,0,0,0.09);
  --border-hover: rgba(0,0,0,0.22);
  --text:         #12112a;
  --text2:        #44436a;
  --text3:        #8888aa;
  --accent:       #6c5ce7;
  --accent2:      #e84393;
  --glow:         0 0 0 3px rgba(108,92,231,0.25);
  --pill-bg:      rgba(108,92,231,0.10);
  --pill-border:  rgba(108,92,231,0.25);
  --error:        #d63060;
  --success:      #0a8f64;
  --fav:          #e07320;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
}

/* ── Background Animations ── */
@keyframes orbFloat1 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(60px, -80px) scale(1.15); }
  66%  { transform: translate(-40px, 40px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes orbFloat2 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-70px, 50px) scale(1.1); }
  66%  { transform: translate(50px, -60px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes orbFloat3 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, 70px) scale(1.2); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes auroraShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes particleDrift {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(30px) rotate(360deg); opacity: 0; }
}

/* ── Body ── */
body {
  font-family: sans-serif,Inter, system-ui;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 16px 60px;
  overflow-y: auto;
  transition: background 0.4s, color 0.4s;
  position: relative;
}

/* ── Animated aurora layer ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(124,108,252,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(232,67,147,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 60% 40%, rgba(74,219,162,0.10) 0%, transparent 55%);
  background-size: 200% 200%;
  animation: auroraShift 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.4s;
}

/* ── Floating orb blobs ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle 320px at 15% 25%, rgba(124,108,252,0.18) 0%, transparent 70%),
    radial-gradient(circle 260px at 85% 70%, rgba(232,67,147,0.16) 0%, transparent 70%),
    radial-gradient(circle 200px at 55% 55%, rgba(74,219,162,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat1 18s ease-in-out infinite;
}

/* ── Floating orb elements (injected by JS) ── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.bg-orb:nth-child(1) {
  width: 420px; height: 420px;
  background: rgba(124,108,252,0.22);
  top: -10%; left: -8%;
  animation: orbFloat1 20s ease-in-out infinite;
}
.bg-orb:nth-child(2) {
  width: 340px; height: 340px;
  background: rgba(232,67,147,0.20);
  bottom: -8%; right: -6%;
  animation: orbFloat2 24s ease-in-out infinite;
}
.bg-orb:nth-child(3) {
  width: 280px; height: 280px;
  background: rgba(74,219,162,0.15);
  top: 45%; left: 60%;
  animation: orbFloat3 16s ease-in-out infinite;
}

/* Lighter in light mode */
[data-theme="light"] .bg-orb  { opacity: 0.28; }
[data-theme="light"] body::after { opacity: 0.45; }

/* ── Back Button ── */
.back-btn {
  position: fixed;
  left: 18px; top: 18px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  z-index: 9999;
  box-shadow: 0 4px 18px rgba(0,0,0,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}
.back-btn:hover { transform: translateX(-3px); box-shadow: 0 6px 22px rgba(0,0,0,0.28); }

/* ── Theme Button ── */
.theme-btn {
  position: fixed;
  right: 18px; top: 18px;
  padding: 8px 16px;
  border-radius: 30px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s, box-shadow 0.2s;
}
.theme-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.2); }

/* ── Page Wrapper ── */
.page-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: background 0.4s, border 0.4s;
}

/* ── Header ── */
.app-header { text-align: center; }
.app-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.app-tagline {
  font-weight: 300;
  font-size: 0.97rem;
  color: var(--text2);
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--text3);
}

/* ── Glass Inputs ── */
.glass-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  appearance: auto;
}
.glass-input::placeholder { color: var(--text3); }
.glass-input:focus {
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.glass-input option {
  background: #1a1a2e;
  color: #f0f0ff;
}
[data-theme="light"] .glass-input option {
  background: #fff;
  color: #12112a;
}

/* ── Primary Button ── */
.primary-btn {
  margin-top: 4px;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 20px rgba(124,108,252,0.35);
}
.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124,108,252,0.5);
}
.primary-btn:active:not(:disabled) { transform: translateY(0); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Result Box ── */
.result-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeSlide 0.4s ease;
}
.result-box.visible { display: flex; }

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

.source-badge {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text3);
}

.activity-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
}

/* ── Pills ── */
.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  padding: 5px 13px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text2);
}

/* Category-colored pill variants */
.pill.free   { background: rgba(74,219,162,0.13); border-color: rgba(74,219,162,0.3); color: var(--success); }
.pill.pricey { background: rgba(255,140,66,0.13);  border-color: rgba(255,140,66,0.3);  color: var(--fav); }

/* ── Result Actions ── */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-btn {
  padding: 8px 18px;
  border-radius: 30px;
  border: 1px solid var(--border-hover);
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { background: var(--surface2); transform: translateY(-1px); }
.icon-btn.secondary { color: var(--text2); }

/* ── Extra Card (Tabs) ── */
.extra-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.extra-card.visible { display: flex; }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; padding: 16px; }
.tab-panel.active { display: block; }

/* ── Item Lists (History / Favs) ── */
.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.item-list li {
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.4;
}

.item-list li span { flex: 1; }

.remove-btn {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.2s;
}
.remove-btn:hover { color: var(--error); }

.empty-state {
  text-align: center;
  color: var(--text3);
  font-size: 0.88rem;
  padding: 12px 0;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-hover);
  border-radius: 30px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Scrollbar (item-list) ── */
.item-list::-webkit-scrollbar { width: 4px; }
.item-list::-webkit-scrollbar-track { background: transparent; }
.item-list::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

/* ── Responsive ── */
@media (max-width: 480px) {
  body { padding: 72px 12px 50px; }
  .card { padding: 22px 16px; }
  .app-title { font-size: 1.65rem; }
  .activity-name { font-size: 1.15rem; }
}