/* MixSide: Cassette Side Balancer Styles */

:root {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-input: #16213e;
  --text: #e0e0e8;
  --text-muted: #8888a8;
  --text-dim: #5a5a7a;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --accent-glow: rgba(233, 69, 96, 0.25);
  --gold: #f5a623;
  --gold-dim: rgba(245, 166, 35, 0.15);
  --green: #4ade80;
  --green-dim: rgba(74, 222, 128, 0.12);
  --border: #2a2a44;
  --border-light: #3a3a5c;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--accent-hover); text-decoration: underline; }

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

.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; color: var(--text); }
.logo:hover, .logo:focus-visible { text-decoration: none; color: var(--text); }
.logo-icon { flex-shrink: 0; }
.main-nav ul { display: flex; list-style: none; gap: 20px; }
.main-nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 48px 0 32px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 12px; background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin: 0 auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  line-height: 1.3;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 0 16px var(--accent-glow); }
.btn-accent:hover { background: var(--accent-hover); box-shadow: 0 0 24px var(--accent-glow); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-outline:hover { background: var(--bg-input); border-color: var(--accent); }
.btn-ghost { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); font-weight: 500; padding: 8px 14px; font-size: 0.85rem; }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-danger-ghost { background: transparent; color: var(--accent); border: 1px solid transparent; }
.btn-danger-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Planner Section */
.planner-section { padding: 24px 0 48px; }
.planner-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }

/* Controls Panel */
.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 72px;
}
.field-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--text-dim); text-transform: none; }

.tape-buttons { display: flex; gap: 8px; }
.tape-btn {
  flex: 1; padding: 10px 8px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 2px solid var(--border);
  color: var(--text-muted); font-family: var(--font); font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: all var(--transition);
  text-align: center;
}
.tape-btn .tape-hint { display: block; font-size: 0.7rem; font-weight: 400; color: var(--text-dim); margin-top: 2px; }
.tape-btn:hover { border-color: var(--accent); color: var(--text); }
.tape-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.tape-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.add-track h2, .presets h2 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.track-form { display: flex; flex-direction: column; gap: 12px; }
.form-row input {
  width: 100%; padding: 10px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font); font-size: 0.9rem;
  transition: border-color var(--transition);
}
.form-row input:focus { outline: none; border-color: var(--accent); }
.form-row input::placeholder { color: var(--text-dim); }
.form-row-dur .duration-inputs { display: flex; align-items: center; gap: 6px; }
.form-row-dur input { width: 60px; text-align: center; }
.dur-sep { color: var(--text-dim); font-weight: 700; }

.preset-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; }

/* Sides Panel */
.sides-panel { display: flex; flex-direction: column; gap: 16px; }

.balance-meter { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.meter-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.meter-track { height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; display: flex; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 4px 0 0 4px; transition: width 0.4s ease; width: 50%; }

.sides-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.side-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 200px;
  display: flex; flex-direction: column;
}
.side-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.side-header h2 { font-size: 1.1rem; font-weight: 700; }
.side-runtime { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.side-max { color: var(--text-dim); }
.side-warning {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--radius-sm); padding: 6px 10px;
  font-size: 0.8rem; font-weight: 600; margin-bottom: 10px;
}

.track-list { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.track-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  cursor: grab; transition: all var(--transition);
}
.track-item:hover { border-color: var(--border-light); }
.track-item.dragging { opacity: 0.5; border-style: dashed; }
.track-item.drag-over { border-color: var(--accent); background: var(--accent-glow); }
.track-drag { color: var(--text-dim); cursor: grab; flex-shrink: 0; font-size: 0.9rem; }
.track-info { flex: 1; min-width: 0; }
.track-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta { font-size: 0.75rem; color: var(--text-dim); }
.track-duration { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.track-remove {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 2px; font-size: 1rem; line-height: 1;
  transition: color var(--transition); flex-shrink: 0;
}
.track-remove:hover { color: var(--accent); }

.side-drop-hint {
  text-align: center; padding: 12px; color: var(--text-dim);
  font-size: 0.8rem; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); margin-top: auto;
}

.total-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 0.9rem;
}
.total-warning { color: var(--gold); font-weight: 600; }

.export-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Guide Section */
.guide-section { padding: 48px 0; background: var(--bg-card); border-top: 1px solid var(--border); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.guide-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.guide-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; color: var(--accent); }
.guide-card p, .guide-card li { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }
.guide-card ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* FAQ Section */
.faq-section { padding: 48px 0; }
.faq-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; text-align: center; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-toggle {
  width: 100%; text-align: left; background: none; border: none;
  color: var(--text); font-family: var(--font); font-size: 0.95rem;
  font-weight: 600; padding: 14px 16px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.faq-toggle::after { content: '+'; font-size: 1.2rem; color: var(--accent); flex-shrink: 0; transition: transform var(--transition); }
.faq-toggle[aria-expanded="true"]::after { content: '−'; }
.faq-toggle:hover { color: var(--accent); }
.faq-item dd { padding: 0 16px 14px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }

/* Footer */
.site-footer {
  margin-top: auto; padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.footer-inner { text-align: center; font-size: 0.85rem; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-meta { color: var(--text-dim); font-size: 0.8rem; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; box-shadow: var(--shadow);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast[hidden] { display: none; }

/* Print Styles */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .controls-panel, .export-actions, .balance-meter, .side-drop-hint, .toast { display: none !important; }
  .side-column { border: 1px solid #ccc; background: #fff; break-inside: avoid; }
  .track-item { border: 1px solid #ddd; background: #f9f9f9; }
  .planner-layout { display: block; }
  .sides-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .total-bar { border: 1px solid #ccc; background: #fff; }
}

/* Responsive */
@media (max-width: 900px) {
  .planner-layout { grid-template-columns: 1fr; }
  .controls-panel { position: static; }
  .sides-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 32px 0 20px; }
  .tape-buttons { flex-direction: column; }
  .export-actions { flex-direction: column; }
  .export-actions .btn { justify-content: center; }
  .main-nav ul { gap: 12px; }
  .main-nav a { font-size: 0.85rem; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
