/* ==========================================================================
   MTStore Music — feuille de style du module
   --------------------------------------------------------------------------
   Autonome : ne dépend d'aucun framework, n'entre pas en conflit avec le
   thème de la marketplace. Toutes les classes sont préfixées « mm- ».
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  --mm-bg:        #07080B;
  --mm-panel:     #0B0C10;
  --mm-card:      #101216;
  --mm-raised:    #15171D;
  --mm-line:      #1A1C22;
  --mm-line-soft: #16181E;

  --mm-text:      #EDEFF4;
  --mm-text-2:    #A9AFC0;
  --mm-text-3:    #7B8393;
  --mm-text-4:    #5A6070;

  --mm-accent:    #4B43E8;
  --mm-accent-2:  #8B84FF;
  --mm-gold:      #E0A82E;
  --mm-green:     #3DD68C;
  --mm-orange:    #F0A030;
  --mm-red:       #FF6B4A;

  --mm-radius:    12px;
  --mm-radius-sm: 8px;
  --mm-sidebar:   238px;
  --mm-topbar:    60px;
  --mm-player:    84px;
}

/* Thème clair, utilisé par le back-office et les écrans de gestion */
.mm-light {
  --mm-bg:        #F4F6FA;
  --mm-panel:     #FFFFFF;
  --mm-card:      #FFFFFF;
  --mm-raised:    #F7F8FB;
  --mm-line:      #E8EBF0;
  --mm-line-soft: #EDEFF3;
  --mm-text:      #14161B;
  --mm-text-2:    #3E4654;
  --mm-text-3:    #5B616D;
  --mm-text-4:    #8A909C;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

.mm { 
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  background: var(--mm-bg);
  color: var(--mm-text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.mm *, .mm *::before, .mm *::after { box-sizing: border-box; }
.mm ::selection { background: var(--mm-accent); color: #fff; }
.mm a { color: var(--mm-accent-2); text-decoration: none; }
.mm a:hover { color: #b3aeff; }
.mm-light a { color: var(--mm-accent); }
.mm-light a:hover { color: #332dbf; }

.mm ::-webkit-scrollbar { width: 8px; height: 8px; }
.mm ::-webkit-scrollbar-thumb { background: #2A2D35; border-radius: 99px; }
.mm-light ::-webkit-scrollbar-thumb { background: #c7ccd4; }

/* --------------------------------------------------------------------------
   Structure applicative
   -------------------------------------------------------------------------- */

.mm-shell { display: flex; min-height: 100vh; }

.mm-sidebar {
  width: var(--mm-sidebar);
  flex-shrink: 0;
  background: var(--mm-panel);
  border-right: 1px solid var(--mm-line-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.mm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.mm-topbar {
  height: var(--mm-topbar);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--mm-line-soft);
  background: var(--mm-panel);
}

.mm-content { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 40px; }
.mm-content--player { padding-bottom: calc(var(--mm-player) + 40px); }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.mm-nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }

.mm-nav__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--mm-radius-sm);
  cursor: pointer;
  color: var(--mm-text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.mm-nav__item:hover { background: var(--mm-raised); color: var(--mm-text); }
.mm-nav__item.is-active { background: #1A1C24; color: var(--mm-text); font-weight: 700; }
.mm-light .mm-nav__item.is-active { background: #EEF0FF; color: var(--mm-accent); }
.mm-nav__item.is-active .mm-nav__icon { color: var(--mm-accent); }
.mm-nav__icon { display: flex; width: 19px; height: 19px; color: var(--mm-text-3); flex-shrink: 0; }
.mm-nav__label { flex: 1; white-space: nowrap; }
.mm-nav__badge {
  font-size: 10.5px; font-weight: 800;
  background: rgba(255,255,255,.08); color: var(--mm-text-3);
  border-radius: 999px; padding: 2px 7px; flex-shrink: 0;
}

.mm-nav__group {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--mm-text-4);
  padding: 14px 11px 6px;
}

/* --------------------------------------------------------------------------
   Cartes et blocs
   -------------------------------------------------------------------------- */

.mm-card {
  background: var(--mm-card);
  border: 1px solid var(--mm-line);
  border-radius: var(--mm-radius);
  padding: 20px 22px;
}
.mm-card--flush { padding: 0; overflow: hidden; }
.mm-card--hover { transition: border-color .18s; }
.mm-card--hover:hover { border-color: #3A3E48; }
.mm-light .mm-card--hover:hover { border-color: #C9CED8; }

.mm-kpi__label { font-size: 12px; font-weight: 700; color: var(--mm-text-3); }
.mm-kpi__value { font-size: 25px; font-weight: 800; letter-spacing: -.032em; margin-top: 6px; }
.mm-kpi__note  { font-size: 12px; color: var(--mm-text-4); margin-top: 3px; }

.mm-grid { display: grid; gap: 14px; }
.mm-grid--2 { grid-template-columns: repeat(2, 1fr); }
.mm-grid--3 { grid-template-columns: repeat(3, 1fr); }
.mm-grid--4 { grid-template-columns: repeat(4, 1fr); }
.mm-grid--5 { grid-template-columns: repeat(5, 1fr); }
.mm-grid--6 { grid-template-columns: repeat(6, 1fr); }

/* --------------------------------------------------------------------------
   Pochettes
   -------------------------------------------------------------------------- */

.mm-art {
  border-radius: var(--mm-radius-sm);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.mm-art--sq  { aspect-ratio: 1; }
.mm-art--wide { aspect-ratio: 16/9; }

.mm-art__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7,8,11,.55);
  opacity: 0; transition: opacity .18s;
}
.mm-tile:hover .mm-art__play { opacity: 1; }

.mm-tile { cursor: pointer; }
.mm-tile__title {
  font-size: 13.5px; font-weight: 700; color: var(--mm-text);
  margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mm-tile__meta {
  font-size: 12px; color: var(--mm-text-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Rangée horizontale défilante */
.mm-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 170px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.mm-rail > * { scroll-snap-align: start; }

/* --------------------------------------------------------------------------
   Liste de pistes
   -------------------------------------------------------------------------- */

.mm-track {
  display: grid;
  grid-template-columns: 32px 1fr 160px 56px 40px;
  gap: 14px;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--mm-radius-sm);
  cursor: pointer;
}
.mm-track:hover { background: var(--mm-raised); }
.mm-track.is-playing { background: rgba(75,67,232,.12); }
.mm-track.is-playing .mm-track__title { color: var(--mm-accent-2); }
.mm-track__num { font-size: 13px; color: var(--mm-text-4); text-align: center; font-variant-numeric: tabular-nums; }
.mm-track__title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-track__artist { font-size: 12px; color: var(--mm-text-3); margin-top: 2px; }
.mm-track__time { font-size: 12.5px; color: var(--mm-text-3); text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Lecteur
   -------------------------------------------------------------------------- */

.mm-player {
  position: fixed;
  left: var(--mm-sidebar); right: 0; bottom: 0;
  height: var(--mm-player);
  background: var(--mm-panel);
  border-top: 1px solid var(--mm-line);
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  z-index: 30;
}

.mm-player__now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mm-player__art { width: 54px; height: 54px; border-radius: 7px; flex-shrink: 0; background-size: cover; }
.mm-player__title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-player__artist { font-size: 12px; color: var(--mm-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mm-player__controls { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.mm-player__buttons { display: flex; align-items: center; gap: 18px; }

.mm-btn-round {
  width: 36px; height: 36px; border-radius: 999px;
  background: #fff; color: #0B0C10;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; transition: transform .12s;
}
.mm-btn-round:hover { transform: scale(1.06); }
.mm-btn-icon {
  background: none; border: none; padding: 0;
  color: var(--mm-text-3); cursor: pointer; display: flex;
  transition: color .15s;
}
.mm-btn-icon:hover { color: var(--mm-text); }
.mm-btn-icon.is-on { color: var(--mm-accent-2); }

.mm-progress {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px;
}
.mm-progress__time { font-size: 11.5px; color: var(--mm-text-4); font-variant-numeric: tabular-nums; min-width: 34px; }
.mm-progress__bar {
  flex: 1; height: 4px; border-radius: 99px;
  background: #22252D; cursor: pointer; position: relative;
}
.mm-progress__fill { height: 100%; border-radius: 99px; background: var(--mm-text); width: 0; }
.mm-progress__bar:hover .mm-progress__fill { background: var(--mm-accent-2); }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */

.mm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 14px; font-weight: 800;
  border-radius: 9px; padding: 12px 22px;
  cursor: pointer; border: 1px solid transparent;
  white-space: nowrap; transition: filter .15s, background .15s;
  font-family: inherit;
}
.mm-btn:hover { filter: brightness(1.1); }
.mm-btn--primary { background: var(--mm-accent); color: #fff; }
.mm-btn--light   { background: #fff; color: #0B0C10; }
.mm-btn--ghost   { background: transparent; color: var(--mm-text); border-color: #2A2D35; }
.mm-btn--ghost:hover { border-color: #4A4F5A; filter: none; }
.mm-btn--gold    { background: var(--mm-gold); color: #2A1B04; }
.mm-btn--green   { background: #16A34A; color: #fff; }
.mm-btn--sm      { font-size: 12.5px; padding: 9px 15px; }

.mm-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--mm-line); color: var(--mm-text-2);
  cursor: pointer; white-space: nowrap;
}
.mm-chip.is-on { background: #fff; color: #0B0C10; border-color: #fff; }
.mm-light .mm-chip.is-on { background: #14161B; color: #fff; border-color: #14161B; }

.mm-tag {
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.mm-tag--green  { background: rgba(61,214,140,.16); color: #7FE3B0; }
.mm-tag--orange { background: rgba(240,160,48,.16); color: #F2C98A; }
.mm-tag--red    { background: rgba(255,107,74,.18); color: #FF9B80; }
.mm-tag--accent { background: rgba(75,67,232,.2);   color: #A8A2FF; }
.mm-tag--muted  { background: rgba(255,255,255,.07); color: #9AA1AE; }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */

.mm-field { margin-bottom: 16px; }
.mm-label { display: block; font-size: 13px; font-weight: 700; color: var(--mm-text-2); margin-bottom: 7px; }
.mm-input, .mm-select, .mm-textarea {
  width: 100%; font-family: inherit; font-size: 14.5px;
  color: var(--mm-text); background: var(--mm-panel);
  border: 1px solid var(--mm-line); border-radius: 9px;
  padding: 12px 15px; outline: none; transition: border-color .15s;
}
.mm-light .mm-input, .mm-light .mm-select, .mm-light .mm-textarea { background: #FBFCFE; border-color: #DDE1E9; }
.mm-input:focus, .mm-select:focus, .mm-textarea:focus { border-color: var(--mm-accent); }
.mm-textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.mm-help { font-size: 11.5px; color: var(--mm-text-4); margin-top: 6px; line-height: 1.5; }
.mm-error { font-size: 12.5px; color: var(--mm-red); margin-top: 6px; }

.mm-switch {
  width: 42px; height: 24px; border-radius: 999px;
  background: #2A2D35; padding: 3px; flex-shrink: 0;
  display: flex; align-items: center; cursor: pointer;
  transition: background .18s; border: none;
}
.mm-switch.is-on { background: var(--mm-accent); }
.mm-switch__knob {
  width: 18px; height: 18px; border-radius: 999px; background: #fff;
  transition: transform .18s;
}
.mm-switch.is-on .mm-switch__knob { transform: translateX(18px); }

/* --------------------------------------------------------------------------
   Tableaux
   -------------------------------------------------------------------------- */

.mm-table { width: 100%; border-collapse: collapse; }
.mm-table th {
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--mm-text-4); text-align: left; padding: 12px 18px;
  background: var(--mm-raised); border-bottom: 1px solid var(--mm-line);
}
.mm-table td { padding: 12px 18px; border-bottom: 1px solid var(--mm-line-soft); font-size: 13.5px; }
.mm-table tbody tr:hover { background: rgba(255,255,255,.045); }
.mm-light .mm-table tbody tr:hover { background: #F7F8FB; }
.mm-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */

.mm-alert {
  display: flex; align-items: flex-start; gap: 13px;
  border-radius: var(--mm-radius); padding: 15px 18px; margin-bottom: 14px;
  font-size: 13.5px; line-height: 1.55;
}
.mm-alert--info    { background: rgba(91,140,255,.07);  border: 1px solid rgba(91,140,255,.28);  color: #9BAAC8; }
.mm-alert--success { background: rgba(61,214,140,.07);  border: 1px solid rgba(61,214,140,.28);  color: #9BC9AE; }
.mm-alert--warning { background: rgba(240,160,48,.07);  border: 1px solid rgba(240,160,48,.3);   color: #D8C09A; }
.mm-alert--danger  { background: rgba(255,107,74,.07);  border: 1px solid rgba(255,107,74,.3);   color: #C88872; }

.mm-empty { text-align: center; padding: 48px 24px; color: var(--mm-text-3); }
.mm-empty__title { font-size: 17px; font-weight: 700; color: var(--mm-text-2); margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   Barre de progression et jauges
   -------------------------------------------------------------------------- */

.mm-bar { height: 5px; border-radius: 99px; background: var(--mm-line); overflow: hidden; }
.mm-bar__fill { height: 100%; background: var(--mm-accent); }

/* --------------------------------------------------------------------------
   Paroles synchronisées
   -------------------------------------------------------------------------- */

.mm-lyrics { display: flex; flex-direction: column; gap: 14px; }
.mm-lyrics__line {
  font-size: 19px; font-weight: 700; color: var(--mm-text-4);
  transition: color .3s, transform .3s; transform-origin: left;
}
.mm-lyrics__line.is-current { color: var(--mm-text); transform: scale(1.02); }
.mm-lyrics__line.is-past { color: var(--mm-text-4); opacity: .55; }

/* --------------------------------------------------------------------------
   Utilitaires
   -------------------------------------------------------------------------- */

.mm-row { display: flex; align-items: center; gap: 12px; }
.mm-row--between { justify-content: space-between; }
.mm-col { display: flex; flex-direction: column; }
.mm-spacer { flex: 1; }
.mm-truncate { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-muted { color: var(--mm-text-3); }
.mm-small { font-size: 12.5px; }
.mm-h1 { font-size: 30px; font-weight: 800; letter-spacing: -.032em; margin: 0; }
.mm-h2 { font-size: 22px; font-weight: 800; letter-spacing: -.026em; margin: 0; }
.mm-h3 { font-size: 16px; font-weight: 800; letter-spacing: -.018em; margin: 0; }
.mm-pretty { text-wrap: pretty; }

@keyframes mm-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mm-fade { animation: mm-fade .22s ease-out; }

@keyframes mm-pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.mm-pulse { animation: mm-pulse 1.6s ease-in-out infinite; }

/* --------------------------------------------------------------------------
   Adaptation mobile
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .mm-grid--5, .mm-grid--6 { grid-template-columns: repeat(3, 1fr); }
  .mm-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mm-sidebar { display: none; }
  .mm-player { left: 0; grid-template-columns: 1fr auto; height: 68px; }
  .mm-player__controls { flex-direction: row; }
  .mm-progress { display: none; }
  .mm-grid--2, .mm-grid--3, .mm-grid--4, .mm-grid--5, .mm-grid--6 { grid-template-columns: repeat(2, 1fr); }
  .mm-content { padding: 16px 14px 40px; }
  .mm-track { grid-template-columns: 1fr 56px; }
  .mm-track__num, .mm-track__album { display: none; }

  /* Barre d'onglets, seulement sur mobile */
  .mm-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0;
    height: 62px; z-index: 31;
    background: var(--mm-panel); border-top: 1px solid var(--mm-line);
    display: flex; align-items: center; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mm-player { bottom: 62px; }
}

@media (min-width: 769px) { .mm-tabbar { display: none; } }
