/* JackBeats custom styles (Utopia-inspired: deep black, gold/copper accents, sand neutrals) */

/* Global theme overrides */
body.bg-slate-950 {
  background-color: #0b0b0b; /* deep noir */
  color: #e9e7df; /* warm off-white */
  font-family: "Chakra Petch", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
/* Title / headings: strong display font */
h1, h2, h3, .title, header h1 {
  font-family: "Bebas Neue", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.02em;
}

header h1 {
  font-size: 2.15rem;
  background: linear-gradient(180deg, #f6e9b8, #caa340 70%, #6b5a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 16px rgba(212,175,55,0.15);
}

button, input, select, output, .row-label, .step-header {
  font-family: "Chakra Petch", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Subtle scanline/noise-ish overlay using gradients (no external assets) */
body.bg-slate-950::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 600px at 50% -20%, rgba(212,175,55,0.12), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(255,140,0,0.08), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0px, rgba(255,255,255,0.018) 1px, transparent 2px, transparent 4px);
  mix-blend-mode: overlay;
  opacity: .75;
}

/* Header/foot glass with metallic gradient overlay */
header::before, footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(0,0,0,0.0) 40%, rgba(255,140,0,0.10) 70%, rgba(0,0,0,0.0));
}
header, footer { position: relative; }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: linear-gradient(180deg, #d4af37, #b38b22);
  color: #101010;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: box-shadow 180ms ease, transform 120ms ease, background 180ms ease;
  border: 1px solid rgba(212,175,55,0.55);
  box-shadow: 0 0 0 0 rgba(212,175,55,0.0);
}
.btn-primary:hover { box-shadow: 0 0 24px 2px rgba(212,175,55,0.35); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[aria-pressed="true"] {
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.35), 0 0 18px 2px rgba(212,175,55,0.3);
  transform: translateY(1px);
  background: linear-gradient(180deg, #caa340, #9f7d1b);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background-color: #151515;
  color: #e9e7df;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 150ms ease, background-color 150ms ease;
  border: 1px solid #2b2b2b;
}
.btn-secondary:hover { background-color: #1a1a1a; border-color: #3a3a3a; }
.btn-secondary:active { background-color: #111; }
.btn-secondary[aria-pressed="true"] {
  background-color: #0f0f0f;
  border-color: #5a5a5a;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.45);
}

/* Sequencer grid headers */
.step-header {
  border-left: 1px solid #262626;
  padding: 0.5rem 0.25rem;
  text-align: center;
  user-select: none;
  color: #b8b4a6;
}
.step-header.beat {
  background-color: rgba(255, 215, 128, 0.06);
  font-weight: 600;
  color: #e9e7df;
}

/* Row label and track controls */
.row-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-top: 1px solid #262626;
  background-color: rgba(20, 20, 20, 0.55);
}
.row-label .btn-pad {
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
}
.row-label .btn-pad.pressed,
.row-label .btn-pad:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.35);
}
.track-controls {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.9;
}
.track-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.track-controls input[type="range"] { accent-color: #d4af37; }
.track-controls select {
  background: #0f0f12;
  border: 1px solid rgba(255,255,255,0.08);
  color: #e5e7eb;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

/* Cells */
.cell {
  border-left: 1px solid #262626;
  border-top: 1px solid #262626;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  background-color: rgba(18, 18, 18, 0.6);
  transition: background-color 150ms ease, box-shadow 150ms ease;
  position: relative;
  touch-action: manipulation;
}
.cell:hover { background-color: rgba(24, 24, 24, 0.8); }
.cell.active {
  background: linear-gradient(180deg, rgba(212,175,55,0.25), rgba(212,175,55,0.08));
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.35), 0 0 0 1px rgba(212,175,55,0.25);
}
.cell.active:hover { background: linear-gradient(180deg, rgba(212,175,55,0.33), rgba(212,175,55,0.12)); }
.cell::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 0.25rem;
  border: 1px solid rgba(200, 170, 80, 0.18);
}

/* Current step playhead highlight */
.cell.playhead {
  outline: 2px solid rgba(232, 191, 96, 0.85);
  outline-offset: -2px;
  box-shadow: 0 0 18px 2px rgba(232, 191, 96, 0.25);
  animation: jb-glow 1s ease-in-out infinite alternate;
}

@keyframes jb-glow {
  from { box-shadow: 0 0 10px 1px rgba(232, 191, 96, 0.18); }
  to   { box-shadow: 0 0 26px 3px rgba(232, 191, 96, 0.35); }
}

/* Color-coded instrument rows (metallic warm variants) */
.row-kick .row-label  { background-color: rgba(181, 150, 66, 0.22); /* brass */ }
.row-snare .row-label { background-color: rgba(184, 115, 51, 0.22); /* copper */ }
.row-hihat .row-label { background-color: rgba(194, 168, 120, 0.20); /* sand */ }
.row-clap .row-label  { background-color: rgba(212, 175, 55, 0.18); /* gold */ }
.row-perc .row-label  { background-color: rgba(140, 120, 83, 0.22);  /* bronze */ }

/* Responsive: keep squares and allow horizontal scroll on small screens */
@media (max-width: 640px) {
  #grid { overflow-x: auto; }
  .cell { min-width: 40px; min-height: 40px; }
}

/* Touch friendly tweaks */
@media (pointer: coarse) {
  .cell { min-width: 44px; min-height: 44px; }
}
