/* ====================================================
   SEMIMUS — Premium Design System v2.0
   SENA Green: #39A900 | Dark BG: #0B0F14
   ==================================================== */

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(57,169,0,0.3); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(57,169,0,0.6); }

/* ── Alpine cloak ── */
[x-cloak] { display: none !important; }

/* ── Smooth scroll ── */
html { scroll-behavior: smooth; }

/* ── Base body ── */
body { background: #0B0F14; color: #fff; }
.light body { background: #F8FAFC; color: #111827; }

/* ══════════════════════════════════════
   SIDEBAR — Spotify Premium Style
   ══════════════════════════════════════ */

.sidebar {
  background: #080C10;
  border-right: 1px solid rgba(255,255,255,0.06);
  width: 256px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: width 0.3s ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 200ms ease;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  position: relative;
  cursor: pointer;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.nav-item:hover svg { transform: scale(1.1); }
.nav-item.active {
  background: #39A900;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(57,169,0,0.35);
}
.nav-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform 200ms ease;
}

/* ══════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════ */

.topbar {
  background: rgba(11,15,20,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.search-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.625rem;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: 0.875rem;
  transition: all 200ms;
  outline: none;
  width: 300px;
}
.search-input::placeholder { color: rgba(255,255,255,0.35); }
.search-input:focus {
  border-color: rgba(57,169,0,0.4);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(57,169,0,0.12);
}

/* Light mode overrides */
.light .search-input {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: #111827;
}
.light .search-input::placeholder { color: #9CA3AF; }
.light .topbar {
  background: rgba(255,255,255,0.95);
  border-bottom-color: #E5E7EB;
}
.light .sidebar { background: #fff; border-right-color: #E5E7EB; }
.light .nav-item { color: #4B5563; }
.light .nav-item:hover { background: #F3F4F6; color: #111827; }
.light .nav-item.active { background: #39A900; color: #fff; }

/* ══════════════════════════════════════
   CARDS — Glassmorphism Premium
   ══════════════════════════════════════ */

.card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 250ms ease;
}

.card-hover:hover {
  border-color: rgba(57,169,0,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(57,169,0,0.1);
  transform: translateY(-2px);
}

.light .card {
  background: #fff;
  border-color: #E5E7EB;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.light .card-hover:hover {
  border-color: rgba(57,169,0,0.3);
  box-shadow: 0 8px 24px rgba(57,169,0,0.08);
}

/* ── Glass card variant ── */
.card-glass {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
}

/* ══════════════════════════════════════
   TRAINING MODE CARDS
   ══════════════════════════════════════ */

.training-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0.875rem;
  padding: 0.875rem;
  cursor: pointer;
  transition: all 250ms ease;
  text-decoration: none;
  display: block;
  overflow: hidden;
  position: relative;
}
.training-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(57,169,0,0.3);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(57,169,0,0.15);
}
.training-card:hover .training-card-img {
  transform: scale(1.05);
}

.training-card-img {
  width: 100%;
  height: 80px;
  border-radius: 0.5rem;
  object-fit: cover;
  transition: transform 300ms ease;
  background: linear-gradient(135deg, #2d2d2d 0%, #4a3728 100%);
}

.light .training-card {
  background: #F8FAFC;
  border-color: #E5E7EB;
}
.light .training-card:hover { border-color: #39A900; }

/* ══════════════════════════════════════
   INSTRUMENT CARDS
   ══════════════════════════════════════ */

.instrument-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0.875rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 280ms ease;
  text-decoration: none;
  display: block;
}
.instrument-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  border-color: rgba(57,169,0,0.3);
}
.instrument-card:hover .instrument-img { transform: scale(1.07); }

.instrument-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  transition: transform 350ms ease;
}

.img-tiple    { background: linear-gradient(145deg, #3D1F08 0%, #8B5E3C 35%, #C4956A 60%, #6B3A1F 100%); }
.img-requinto { background: linear-gradient(145deg, #2A1506 0%, #704214 35%, #A0522D 60%, #4A2210 100%); }
.img-bandola  { background: linear-gradient(145deg, #1A0C04 0%, #5C3D2E 35%, #8B6B52 60%, #3D2010 100%); }

.light .instrument-card { background: #fff; border-color: #E5E7EB; }

/* ══════════════════════════════════════
   XP BAR — Animated
   ══════════════════════════════════════ */

.xp-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #39A900, #4ADE80);
  border-radius: 9999px;
  position: relative;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.xp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  border-radius: 9999px;
  animation: xpShimmer 2s ease-in-out infinite;
}
@keyframes xpShimmer {
  0%, 100% { opacity: 0; transform: translateX(-20px); }
  50% { opacity: 1; transform: translateX(10px); }
}

.xp-bar-mini {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 9999px;
  overflow: hidden;
}
.xp-bar-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #39A900, #4ADE80);
  border-radius: 9999px;
  transition: width 1s ease;
}

.light .xp-bar-track { background: #E5E7EB; }
.light .xp-bar-mini { background: #E5E7EB; }

/* ══════════════════════════════════════
   BUTTONS — Premium
   ══════════════════════════════════════ */

.btn-sena {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #39A900;
  color: #fff;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn-sena:hover {
  background: #2d8a00;
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(57,169,0,0.45);
}
.btn-sena:active { transform: scale(0.97); }

.btn-sena-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  color: #39A900;
  border: 1px solid #39A900;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
}
.btn-sena-outline:hover {
  background: rgba(57,169,0,0.1);
  transform: scale(1.02);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.2); }

/* ── Primary (legacy) ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.625rem 1.25rem; background: #39A900; color: #fff;
  border-radius: 0.75rem; font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: background 150ms, transform 100ms, box-shadow 150ms;
  text-decoration: none;
}
.btn-primary:hover { background: #2d8a00; box-shadow: 0 4px 16px rgba(57,169,0,0.4); }
.btn-primary:active { transform: scale(0.98); }

/* ══════════════════════════════════════
   AUDIO PLAYER — Spotify Style
   ══════════════════════════════════════ */

.audio-player {
  background: #0B0F14;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.audio-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #39A900;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 200ms ease;
  box-shadow: 0 0 0 0 rgba(57,169,0,0.4);
}
.audio-play-btn:hover {
  background: #4ADE80;
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(57,169,0,0.15);
}
.audio-play-btn.playing { animation: pulseGreenBtn 1.5s ease-in-out infinite; }

@keyframes pulseGreenBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(57,169,0,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(57,169,0,0); }
}

.waveform-container {
  flex: 1;
  height: 48px;
  position: relative;
  overflow: hidden;
}

.waveform-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}
.waveform-bar {
  flex: 1;
  background: rgba(57,169,0,0.25);
  border-radius: 2px;
  transition: height 100ms ease;
  min-width: 2px;
}
.waveform-bar.active { background: #39A900; }
.waveform-bar.played { background: rgba(57,169,0,0.6); }

@keyframes waveAnim {
  0%, 100% { height: 20%; }
  50% { height: 80%; }
}
.waveform-bar.playing { animation: waveAnim 0.8s ease-in-out infinite; }

/* ══════════════════════════════════════
   TRAINING ANSWER OPTIONS
   ══════════════════════════════════════ */

.option-btn {
  width: 100%;
  text-align: left;
  padding: 0.875rem 1.125rem;
  border-radius: 0.75rem;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  font-weight: 500;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  transition: all 200ms ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.option-btn:hover:not(:disabled) {
  border-color: rgba(57,169,0,0.4);
  background: rgba(57,169,0,0.08);
  color: #fff;
}
.option-btn:disabled { cursor: not-allowed; opacity: 0.75; }
.option-btn.correct {
  border-color: #39A900 !important;
  background: rgba(57,169,0,0.15) !important;
  color: #4ADE80 !important;
}
.option-btn.wrong {
  border-color: #F87171 !important;
  background: rgba(248,113,113,0.1) !important;
  color: #FCA5A5 !important;
}

.light .option-btn {
  background: #F8FAFC;
  border-color: #E5E7EB;
  color: #111827;
}
.light .option-btn:hover:not(:disabled) { border-color: #39A900; background: rgba(57,169,0,0.05); }

/* ══════════════════════════════════════
   PROGRESS BAR — Mode Cards
   ══════════════════════════════════════ */

.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-fill { height: 100%; border-radius: 9999px; transition: width 1s ease; }

.light .progress-bar { background: #E5E7EB; }

/* ══════════════════════════════════════
   STAT MINI CARDS
   ══════════════════════════════════════ */

.stat-mini {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.stat-mini .stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.stat-mini .stat-label {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-mini .stat-change {
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 0.125rem;
}
.stat-change.up { color: #4ADE80; }
.stat-change.down { color: #F87171; }

.light .stat-mini .stat-value { color: #111827; }
.light .stat-mini .stat-label { color: #6B7280; }

/* ══════════════════════════════════════
   TOP LEARNERS
   ══════════════════════════════════════ */

.learner-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.learner-item:last-child { border-bottom: none; }
.learner-item.is-current { color: #39A900; }

.learner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #39A900, #1a5200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.light .learner-item { border-bottom-color: #F3F4F6; }

/* ══════════════════════════════════════
   CORRECT ANSWER CARD
   ══════════════════════════════════════ */

.correct-card {
  background: linear-gradient(145deg, #111827 0%, #0f1f0f 100%);
  border: 1px solid rgba(57,169,0,0.2);
  border-radius: 1rem;
  overflow: hidden;
}

.correct-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #39A900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(57,169,0,0.4);
}

/* ══════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes audio-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.4s ease-out forwards; }
.animate-slide-right { animation: slideRight 0.4s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.audio-playing { animation: audio-pulse 0.7s ease-in-out infinite; }

/* Stagger delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ══════════════════════════════════════
   FORM INPUTS
   ══════════════════════════════════════ */

.form-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  background: rgba(255,255,255,0.05);
  color: #fff;
  transition: border-color 200ms, box-shadow 200ms;
  outline: none;
}
.form-input::placeholder { color: rgba(255,255,255,0.3); }
.form-input:focus {
  border-color: #39A900;
  box-shadow: 0 0 0 3px rgba(57,169,0,0.15);
}

.light .form-input {
  background: #fff;
  border-color: #D1D5DB;
  color: #111827;
}
.light .form-input::placeholder { color: #9CA3AF; }
.light .form-input:focus { border-color: #39A900; box-shadow: 0 0 0 3px rgba(57,169,0,0.12); }

/* ══════════════════════════════════════
   THEME TOGGLE
   ══════════════════════════════════════ */

.theme-toggle {
  width: 42px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 200ms;
  border: none;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle.active { background: #39A900; }
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 200ms ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.theme-toggle.active::after { transform: translateX(18px); }

/* ══════════════════════════════════════
   TABS
   ══════════════════════════════════════ */

.tab-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 150ms;
  border: none;
  background: transparent;
}
.tab-btn.active {
  color: #39A900;
  background: rgba(57,169,0,0.1);
}
.tab-btn:hover:not(.active) { color: rgba(255,255,255,0.7); }

.light .tab-btn { color: #9CA3AF; }
.light .tab-btn.active { color: #39A900; background: rgba(57,169,0,0.08); }

/* ══════════════════════════════════════
   SECTION HEADINGS
   ══════════════════════════════════════ */

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.875rem;
}
.light .section-title { color: #111827; }

/* ══════════════════════════════════════
   NOTIFICATION BADGE
   ══════════════════════════════════════ */

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: #EF4444;
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #080C10;
}

/* ══════════════════════════════════════
   LIGHT MODE MAIN AREA
   ══════════════════════════════════════ */

.main-content { background: #0B0F14; min-height: 100vh; }
.light .main-content { background: #F8FAFC; }

/* ══════════════════════════════════════
   LEVEL BADGE
   ══════════════════════════════════════ */

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: #39A900;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

/* ══════════════════════════════════════
   STREAK FLAME
   ══════════════════════════════════════ */

.streak-icon {
  font-size: 2rem;
  animation: float 2s ease-in-out infinite;
}

/* ══════════════════════════════════════
   CHALLENGE PROGRESS
   ══════════════════════════════════════ */

.challenge-progress {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 9999px;
  overflow: hidden;
}
.challenge-fill {
  height: 100%;
  background: linear-gradient(90deg, #39A900, #4ADE80);
  border-radius: 9999px;
  transition: width 0.8s ease;
}

.light .challenge-progress { background: #E5E7EB; }

/* ══════════════════════════════════════
   PRINT
   ══════════════════════════════════════ */

@media print {
  .sidebar, .topbar { display: none !important; }
  .main-content { padding: 0 !important; }
}

/* ══════════════════════════════════════
   RANGE SLIDER
   ══════════════════════════════════════ */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #39A900;
  box-shadow: 0 2px 6px rgba(57,169,0,0.4);
}

/* ══════════════════════════════════════
   TYPEWRITER CURSOR
   ══════════════════════════════════════ */

.typewriter-cursor::after {
  content: '|';
  animation: blink 0.8s step-end infinite;
  color: #39A900;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
