/* ==========================================================================
   BandBangla - Notation Engine & Karaoke Cursor Stylesheet
   Styles for VexFlow SVG staff, interactive control bar & playback tracker
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Interactive Control Bar
   -------------------------------------------------------------------------- */
.notation-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-card, #16223b);
  border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.16));
  border-bottom: none;
  border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
}

.playback-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 40px;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm, 4px);
  color: var(--text-primary, #f8fafc);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast, 0.18s ease-in-out);
  user-select: none;
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-medium, rgba(255, 255, 255, 0.2));
  transform: translateY(-1px);
}

.btn-ctrl:active {
  transform: translateY(0);
}

.btn-ctrl-play {
  background: var(--gold-gradient, linear-gradient(135deg, #fce08b 0%, #e5a93b 50%, #b87c1c 100%));
  color: #070b14;
  border-color: rgba(229, 169, 59, 0.6);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(229, 169, 59, 0.3);
}

.btn-ctrl-play:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(229, 169, 59, 0.45);
}

.btn-ctrl-play.is-playing {
  background: #f87171;
  color: #070b14;
  border-color: #ef4444;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-ctrl-toggle.is-active {
  background: rgba(229, 169, 59, 0.2);
  border-color: var(--brass-gold, #e5a93b);
  color: var(--brass-gold-light, #f7cb68);
}

/* Tempo Slider & BPM Display */
.tempo-control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 4px);
  padding: 0.35rem 0.85rem;
}

.tempo-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #94a3b8);
}

.tempo-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.tempo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brass-gold, #e5a93b);
  border: 2px solid #070b14;
  box-shadow: 0 0 6px rgba(229, 169, 59, 0.6);
  cursor: pointer;
  transition: transform 0.1s;
}

.tempo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.tempo-value-display {
  font-family: var(--font-mono, monospace);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brass-gold-light, #f7cb68);
  min-width: 58px;
  text-align: right;
}

/* --------------------------------------------------------------------------
   2. Staff Container & Viewport
   -------------------------------------------------------------------------- */
.notation-stage-wrapper {
  position: relative;
  width: 100%;
  background: #090e1a;
  border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.16));
  border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-overflow-scrolling: touch;
}

.notation-viewport {
  position: relative;
  min-width: 100%;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 1rem 1rem;
}

/* VexFlow SVG Inversion & Color Overrides for Dark Navy Academy Theme */
.notation-viewport svg {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.notation-viewport svg path,
.notation-viewport svg rect,
.notation-viewport svg text {
  fill: #e2e8f0 !important;
  stroke: #e2e8f0 !important;
}

/* Stave lines softer slate */
.notation-viewport svg path.vf-stave-line {
  stroke: rgba(226, 232, 240, 0.55) !important;
}

/* --------------------------------------------------------------------------
   3. Karaoke Tracking Cursor
   -------------------------------------------------------------------------- */
.karaoke-tracker {
  position: absolute;
  top: 15px;
  bottom: 15px;
  width: 4px;
  background: linear-gradient(180deg, rgba(229, 169, 59, 0) 0%, rgba(229, 169, 59, 0.95) 20%, rgba(229, 169, 59, 1) 50%, rgba(229, 169, 59, 0.95) 80%, rgba(229, 169, 59, 0) 100%);
  border-radius: 2px;
  box-shadow: 0 0 16px rgba(229, 169, 59, 0.85), 0 0 30px rgba(247, 203, 104, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, left 0.12s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 20;
}

.karaoke-tracker.is-active {
  opacity: 1;
}

/* Top Badge on Cursor */
.karaoke-tracker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #fce08b;
  border-radius: 50%;
  box-shadow: 0 0 10px #fce08b;
}

/* Active Note Highlight Styling */
.vf-active-note path,
.vf-active-note rect,
.vf-active-note text {
  fill: #f7cb68 !important;
  stroke: #f7cb68 !important;
  filter: drop-shadow(0 0 6px rgba(229, 169, 59, 0.9)) !important;
  transition: fill 0.1s ease, stroke 0.1s ease;
}

/* --------------------------------------------------------------------------
   4. Status & Diagnostics Bar
   -------------------------------------------------------------------------- */
.notation-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(11, 18, 32, 0.9);
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim, #64748b);
}

.status-dot.ready {
  background: var(--highland-emerald, #10b981);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.status-dot.playing {
  background: var(--brass-gold, #e5a93b);
  box-shadow: 0 0 8px rgba(229, 169, 59, 0.8);
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* --------------------------------------------------------------------------
   5. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .notation-control-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .playback-btn-group {
    justify-content: center;
  }
  .tempo-control-group {
    justify-content: space-between;
  }
  .tempo-slider {
    flex: 1;
    max-width: 180px;
  }
}
