/**
 * assets/css/distribution.css
 * Estilos completos para o Módulo de Distribuição 1MZ/WeOne.
 * Tema: Dark Mode (Preto, Cinza Escuro, Branco, Laranja e Verde).
 */

/* ==========================================================================
   1. LAYOUT GERAL & RESET
   ========================================================================== */

/* Aplica o fundo escuro e layout a todos os containers principais
 * 
 * v3 (Abril 2026): técnica "full-bleed" melhorada baseada no frontend.css
 * para completar a tela do usuário em desktop e mobile.
 *
 * Como funciona: usamos `margin-left/right: calc(50% - 50vw)` o que
 * "puxa" o contentor para fora da coluna pai até atingir as bordas do
 * viewport. Combinado com `max-width: 1280px` em desktop, mantém o
 * conteúdo num tamanho legível em monitores grandes.
 *
 * Vantagens sobre `transform: translateX(-50%) + width: 100vw`:
 *   - Não cria novo "containing block" para position:fixed descendentes
 *   - Não é cancelado por overflow:hidden ou transform em pais
 *   - Não causa scroll horizontal involuntário
 *   - Compatível com modais e overlays
 *
 * Em mobile (≤768px) o comportamento é redefinido para full-width.
 */
/* Base containers - layout partilhado (desktop e mobile). */
.distro-dashboard,
.distro-analytics-container,
.distro-wizard-container,
.distro-single-view,
.distro-list-container,
.distro-paywall-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #121212;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 30px;
    box-sizing: border-box;
}

/* Wizard específico - alinhado com outros containers */
.rmbz-wizard-v2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #121212;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 30px;
    box-sizing: border-box;
}

/* [REFACTOR 1.5.11] Full-bleed SÓ em desktop (≥769px).
   Antes a técnica `margin-left: calc(50% - 50vw)` aplicava-se por default
   e depois era sobreposta no @media (max-width: 768px), mas isso causava
   um "flash" visual no mobile — por instantes o container esticava para
   100vw antes do browser aplicar o media query mobile. Agora o full-bleed
   só existe em desktop; no mobile o container nasce já limpo. */
@media (min-width: 769px) {
    .distro-dashboard,
    .distro-analytics-container,
    .distro-wizard-container,
    .distro-single-view,
    .distro-list-container,
    .distro-paywall-container,
    .rmbz-wizard-v2 {
        /* Full-bleed: escapa à coluna estreita do tema como no frontend.css */
        width: auto;
        max-width: 1280px;
        margin-top: 20px;
        margin-bottom: 20px;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
}

/* Em ecrãs desktop grandes (>1320px) centra a 1280px com margens automáticas 
   — evita chegar às bordas absolutas, fica mais elegante e legível */
@media (min-width: 1320px) {
    .distro-dashboard,
    .distro-analytics-container,
    .distro-wizard-container,
    .distro-single-view,
    .distro-list-container,
    .distro-paywall-container {
        margin-left: auto;
        margin-right: auto;
        width: min(1280px, calc(100vw - 60px));
        box-shadow: 0 20px 60px rgba(0,0,0,0.3); /* Sombra mais sutil em telas grandes */
    }
}

/* Header Geral */
.distro-header, .analytics-header, .wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.distro-header h1, .analytics-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

/* Botões Globais */
.onemz-btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}
.btn-primary:hover {
    background-color: #2980b9;
}


/* ==========================================================================
   2. DASHBOARD (CARDS E ESTATÍSTICAS)
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-label { font-size: 14px; color: #aaa; }
.stat-value { font-size: 32px; font-weight: 700; color: #fff; }

.withdraw-btn {
    position: absolute; top: 20px; right: 20px;
    background: transparent; border: 1px solid #fff; color: #fff;
    padding: 5px 15px; border-radius: 20px; font-size: 12px;
    text-transform: uppercase; cursor: pointer; text-decoration: none; transition: 0.2s;
}
.withdraw-btn:hover { background: #fff; color: #000; }
.withdraw-btn:disabled { border-color: #555; color: #555; pointer-events: none; opacity: 0.5; }

.pro-badge { color: #f0b90b; font-weight: 800; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.new-feature-badge { background: #2ecc71; color: #000; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold; display: inline-block; margin-bottom: 5px; }

/* Banners */
.promo-banner {
    background-color: #1e1e1e; border-radius: 8px; padding: 20px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; border: 1px solid #333;
}

.btn-outline {
    border: 1px solid #fff; color: #fff; padding: 8px 20px;
    border-radius: 20px; text-decoration: none; font-size: 14px;
    transition: 0.2s; background: transparent; cursor: pointer;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* Contas Artistas */
.artist-accounts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 40px; }
.account-card { background: linear-gradient(135deg, #2c3e50, #1e1e1e); padding: 20px; border-radius: 8px; display: flex; align-items: center; gap: 15px; }
.account-card.spotify { background: linear-gradient(135deg, #4b2a85, #1e1e1e); } 
.account-card.apple { background: linear-gradient(135deg, #e74c3c, #1e1e1e); } 

/* Grid Lançamentos (Cards) */
.releases-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.releases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }

/* CRITICAL: Os links <a> que envolvem cada release-card são filhos directos da
 * grid. Como <a> é inline por defeito, sem esta regra cada link ocupava apenas
 * o tamanho do conteúdo natural da imagem (covers maiores ficavam enormes,
 * covers pequenas ficavam minúsculas — bug visual reportado em mobile).
 * Forçamos display:block + width:100% + min-width:0 para que cada link
 * preencha a célula da grid uniformemente. */
.releases-grid > a {
    display: block;
    width: 100%;
    min-width: 0;
    text-decoration: none;
}

.release-card { position: relative; cursor: pointer; transition: transform 0.2s; display: block; width: 100%; }
.release-card:hover { transform: translateY(-5px); }

.cover-wrap { position: relative; width: 100%; }
.cover-img { width: 100%; aspect-ratio: 1/1; border-radius: 8px; background-color: #333; object-fit: cover; display: block; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.status-pill { position: absolute; bottom: 10px; left: 10px; background: rgba(46, 204, 113, 0.9); color: #fff; font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: bold; display: flex; align-items: center; gap: 5px; z-index: 2; }

.release-title { display: block; color: #fff; font-size: 14px; margin-top: 10px; font-weight: 500; line-height: 1.4; padding: 0 2px; }
/* Apenas dentro da GRID de capas (cards): truncar com ellipsis numa linha.
 * Esta restrição é importante porque a list-view tem outro elemento
 * .release-title (no .release-main-info) que PRECISA de quebrar em múltiplas
 * linhas para títulos longos. Sem este escope, a regra global de nowrap
 * cortava o título "Among Us (Theme Song Edm Electro House)" na list-view. */
.releases-grid .release-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-release-card { border: 2px dashed #444; border-radius: 8px; display: flex; justify-content: center; align-items: center; aspect-ratio: 1/1; background: #1e1e1e; transition: 0.2s; }
.add-release-card:hover { border-color: #f0b90b; }
.plus-btn { width: 50px; height: 50px; background: #333; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 24px; color: #fff; }

/* Botões Rodapé */
.footer-actions { margin-top: 30px; display: flex; gap: 15px; }
.btn-gradient {
    background: linear-gradient(90deg, #f0b90b, #e67e22); border: none; color: #fff;
    padding: 12px 25px; border-radius: 30px; font-weight: bold; cursor: pointer;
    text-transform: uppercase; font-size: 14px; box-shadow: 0 4px 15px rgba(240, 185, 11, 0.3);
    text-decoration: none; display: inline-block;
}
.btn-gradient:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary-outline { background: transparent; border: 1px solid #555; color: #fff; padding: 12px 25px; border-radius: 30px; font-weight: bold; cursor: pointer; text-transform: uppercase; font-size: 14px; text-decoration: none; display: inline-block; }


/* ==========================================================================
   3. LISTA DETALHADA (DISCOGRAFIA)
   ========================================================================== */

.distro-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 15px; }
.filter-group label { display: block; font-size: 12px; color: #ccc; font-weight: bold; margin-bottom: 5px; }
.filter-group input, .filter-group select { width: 100%; background-color: #1e1e1e; border: 1px solid #444; color: #fff; padding: 8px 10px; border-radius: 4px; font-size: 13px; }

.filter-actions { display: flex; gap: 10px; margin-bottom: 20px; }
.btn-filter-apply { background: linear-gradient(90deg, #ff9f43, #ff6b6b); border: none; color: #fff; padding: 8px 20px; border-radius: 20px; font-weight: bold; font-size: 12px; cursor: pointer; }
.btn-filter-reset { background: transparent; border: 1px solid #fff; color: #fff; padding: 8px 20px; border-radius: 20px; font-weight: bold; font-size: 12px; cursor: pointer; }

.results-count { font-size: 13px; color: #aaa; margin-bottom: 15px; }

.release-item { background-color: #181818; border: 1px solid #333; display: flex; flex-wrap: wrap; padding: 20px; margin-bottom: 15px; border-radius: 4px; align-items: flex-start; gap: 20px; }
.release-cover { width: 120px; height: 120px; position: relative; flex-shrink: 0; }
.release-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.icon-overlay { position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,0.6); border-radius: 50%; width: 24px; height: 24px; display: flex; justify-content: center; align-items: center; font-size: 12px; }

.release-main-info {
  flex: 2;
  /* min-width: 0 é CRÍTICO em flex children — sem isto, o conteúdo com
     palavras longas pode forçar a célula flex a expandir além do container.
     Antes era min-width:300px, mas isso causava overflow em telas <340px.
     Agora usamos min-width:0 (default flex children é 'auto' que herda
     o width intrínseco do conteúdo, causando o problema). */
  min-width: 0;
}
.release-title {
  font-size: 18px;
  color: #fff;
  margin: 0;
  font-weight: bold;
  text-decoration: underline;
  text-decoration-color: #555;
  margin-bottom: 2px;
  /* Permitir quebra de títulos longos como "Among Us (Theme Song Edm
     Electro House)". overflow-wrap em vez de word-break para respeitar
     palavras e quebrar apenas quando necessário. !important para vencer
     a regra global da releases-grid em casos de cascade conflitante. */
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  hyphens: auto;
  /* Anular qualquer white-space:nowrap que possa vir herdado de outros
     contextos (defesa em profundidade). */
  white-space: normal !important;
  /* Garantir que nunca ultrapassa o pai */
  max-width: 100%;
}
.release-artist { font-size: 13px; color: #aaa; display: block; margin-bottom: 15px; }

.release-meta-grid { display: grid; grid-template-columns: 140px 1fr; gap: 5px 10px; font-size: 12px; margin-bottom: 15px; }
.meta-label { color: #ccc; }
.meta-value { color: #fff; font-weight: 500; }

/* Badges de Status */
.status-badge { display: inline-block; padding: 5px 15px; border-radius: 20px; font-size: 12px; font-weight: bold; text-transform: capitalize; cursor: default; }
.status-live { background-color: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
.status-incomplete { background-color: rgba(230, 126, 34, 0.2); color: #e67e22; border: 1px solid #e67e22; }
.status-processing { background-color: rgba(52, 152, 219, 0.2); color: #3498db; border: 1px solid #3498db; }

.release-actions { flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 180px; }
.btn-text-action { background: none; border: none; color: #fff; font-weight: bold; font-size: 12px; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.btn-text-action:hover { text-decoration: underline; }
.btn-distribute { background: linear-gradient(90deg, #ff9f43, #ff6b6b); border: none; color: #fff; padding: 10px 25px; border-radius: 20px; font-weight: 800; text-transform: uppercase; font-size: 12px; cursor: pointer; box-shadow: 0 4px 10px rgba(255, 107, 107, 0.3); transition: transform 0.2s; }
.btn-distribute:hover { transform: translateY(-2px); filter: brightness(1.1); }


/* ==========================================================================
   4. SINGLE RELEASE VIEW (DETALHES)
   ========================================================================== */

.back-link { color: #888; text-decoration: none; font-size: 14px; }
.back-link:hover { color: #fff; }

.ds-top-bar {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #333;
}
.steps-badge {
    border: 1px solid #f0b90b; color: #f0b90b; padding: 5px 15px;
    border-radius: 20px; font-size: 12px; font-weight: bold;
}

/* Header Detalhes */
.ds-header { display: flex; gap: 30px; margin-bottom: 30px; }
.ds-cover img { width: 180px; height: 180px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.5); }
.ds-title { font-size: 32px; font-weight: 800; color: #fff; margin: 0 0 10px 0; }
.ds-artist { color: #aaa; margin-bottom: 20px; }

.btn-outline-action { background: transparent; border: 1px solid #fff; color: #fff; padding: 10px 20px; border-radius: 30px; font-weight: bold; cursor: pointer; text-transform: uppercase; font-size: 12px; }
.btn-outline-action:hover { background: rgba(255,255,255,0.1); }

/* Banner de Status */
.ds-status-banner { background: #181818; border: 1px solid #333; border-radius: 8px; padding: 20px; display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.ds-status-banner.live-mode { border-left: 4px solid #2ecc71; }
.ds-status-banner.pending-mode { border-left: 4px solid #f0b90b; }

.status-icon-circle { width: 50px; height: 50px; border-radius: 50%; background: #2ecc71; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #000; }
.pending-mode .status-icon-circle { background: #f0b90b; }

.status-text { flex: 1; }
.status-text strong { display: block; font-size: 18px; color: #2ecc71; margin-bottom: 5px; }
.pending-mode .status-text strong { color: #f0b90b; }
.status-text p { margin: 0; color: #ccc; font-size: 14px; }
.status-text small { color: #666; font-size: 11px; margin-top: 5px; display: block; }

.btn-outline-small { background: transparent; border: 1px solid #555; color: #fff; padding: 8px 15px; border-radius: 20px; font-size: 11px; text-transform: uppercase; cursor: pointer; }

/* Links Grid & Profiles */
.section-title { font-size: 18px; color: #fff; margin-bottom: 15px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.links-grid, .profiles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; margin-bottom: 40px; }
.link-box, .profile-card { background: #252525; border-radius: 6px; padding: 10px 15px; border: 1px solid #333; }
.profile-card { padding: 15px; display: flex; align-items: center; gap: 15px; background: #1e1e1e; }

.lb-header { display: flex; justify-content: space-between; font-size: 12px; color: #888; margin-bottom: 5px; }
.lb-val { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: monospace; }

.pc-icon { width: 32px; height: 32px; border-radius: 4px; background: #333; }
.spotify-icon { background: #1db954; }
.apple-icon { background: #fa243c; }
.pc-info { flex: 1; }
.pc-info strong { display: block; font-size: 14px; color: #fff; }
.pc-info small { color: #888; font-size: 11px; }

/* Cartões de Detalhes (Estilo Among Us) */
.ds-card { background: #181818; border: 1px solid #333; border-radius: 6px; margin-bottom: 20px; overflow: hidden; }
.ds-card-header { background: #202020; padding: 15px 20px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; }
.ds-card-header h3 { margin: 0; font-size: 16px; color: #fff; display: flex; align-items: center; gap: 10px; }
.ds-card-body { padding: 20px; }

.btn-edit-icon { color: #fff; text-decoration: none; font-size: 12px; font-weight: bold; text-transform: uppercase; }
.btn-edit-text { color: #fff; font-size: 11px; font-weight: bold; text-decoration: none; }
.badge-auto { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; padding: 2px 8px; border-radius: 4px; font-size: 10px; text-transform: uppercase; }

/* Info Rows e Grid */
.ds-info-row { display: flex; gap: 20px; margin-bottom: 20px; }
.ds-info-col { display: flex; flex-direction: column; }
.ds-info-col label { font-size: 11px; color: #888; margin-bottom: 5px; }
.ds-info-col strong { font-size: 18px; color: #fff; }
.ds-info-col.main strong { font-size: 24px; }

.ds-grid-gray { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #333; border-radius: 4px; overflow: hidden; border: 1px solid #333; }
.ds-gray-item { background: #252525; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.ds-gray-item span { color: #888; }
.ds-gray-item strong { color: #fff; }

/* Ícones das Lojas */
.icons-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.icons-row img { width: 30px; height: 30px; border-radius: 4px; object-fit: contain; background: #fff; padding: 2px; }

/* Faixas (Tracks) */
.ds-track-row { display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px solid #2a2a2a; background: #1c1c1c; }
.ds-track-row:last-child { border-bottom: none; }
.ds-tr-num { width: 30px; color: #888; font-weight: bold; }
.ds-tr-info { display: flex; flex-direction: column; }
.ds-tr-info strong { color: #fff; font-size: 14px; }
.ds-tr-info small { color: #666; font-size: 11px; margin-top: 3px; }

.details-table-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: #252525; border: 1px solid #333; border-radius: 6px; margin-bottom: 40px; }
.dt-cell { padding: 15px; border-right: 1px solid #333; border-bottom: 1px solid #333; }
.details-table-grid .dt-cell:nth-child(4n) { border-right: none; }
.dt-label { display: block; font-size: 11px; color: #888; text-transform: uppercase; margin-bottom: 5px; }
.dt-val { font-size: 13px; color: #fff; font-weight: bold; }

.tracks-list-container { background: #1e1e1e; border: 1px solid #333; border-radius: 6px; }
.track-row { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid #333; }
.track-row:last-child { border-bottom: none; }
.track-row:hover { background: #252525; }
.tr-num { width: 30px; color: #888; font-size: 13px; }
.tr-main { flex: 1; }
.tr-title { display: block; color: #fff; font-size: 14px; }
.tr-meta { font-size: 11px; color: #888; }
.tr-dur { color: #ccc; font-size: 13px; font-family: monospace; }


/* ==========================================================================
   5. ANALYTICS VIEW
   ========================================================================== */

.analytics-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-green-gradient { background: linear-gradient(90deg, #1db954, #1ed760); border: none; color: #000; padding: 10px 20px; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 13px; text-transform: uppercase; }

.analytics-tabs { border-bottom: 2px solid #333; margin-bottom: 30px; display: flex; gap: 30px; }
.an-tab { color: #888; text-decoration: none; padding-bottom: 10px; font-size: 13px; font-weight: bold; text-transform: uppercase; border-bottom: 3px solid transparent; transition: 0.2s; }
.an-tab.active, .an-tab:hover { color: #f0b90b; border-bottom-color: #f0b90b; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.kpi-card { background: #181818; padding: 20px; border-radius: 6px; position: relative; border: 1px solid #2a2a2a; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi-label { font-size: 14px; font-weight: bold; color: #fff; }
.kpi-value { font-size: 36px; font-weight: 800; color: #fff; margin: 10px 0; }
.kpi-value.warning-color { color: #f0b90b; }
.kpi-link { font-size: 12px; color: #aaa; text-decoration: none; text-align: right; display: block; }
.kpi-link:hover { color: #fff; }

.progress-bar-bg { background: #333; height: 8px; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { background: #f0b90b; height: 100%; border-radius: 4px; }

.chart-section-wrapper { background: #181818; padding: 20px; border-radius: 8px; margin-bottom: 30px; border: 1px solid #2a2a2a; }
.chart-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.chart-filters select { background: #252525; color: #fff; border: 1px solid #444; padding: 5px 10px; border-radius: 4px; margin-left: 10px; }

.bottom-analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; }
.panel-box { background: #181818; border: 1px solid #2a2a2a; border-radius: 8px; padding: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-header h3 { margin: 0; font-size: 20px; color: #fff; }

.track-stat-row { display: flex; align-items: center; border-bottom: 1px solid #333; padding: 15px 0; gap: 15px; }
.track-stat-row:last-child { border-bottom: none; }
.mini-cover { width: 40px; height: 40px; border-radius: 4px; }
.ts-info { flex: 1; }
.ts-info strong { display: block; font-size: 14px; text-decoration: underline; cursor: pointer; }
.ts-info small { color: #888; font-size: 12px; }
.ts-val { text-align: right; margin-right: 15px; }
.ts-val strong { font-size: 16px; color: #fff; }
.ts-val small { font-size: 10px; color: #aaa; text-transform: uppercase; }

.mini-sparkline { width: 60px; height: 30px; display: flex; align-items: center; }
.spark-line { width: 100%; height: 2px; background: #555; position: relative; }
.spark-line.down::after { content: ''; position: absolute; right: 0; top: 0; width: 100%; height: 2px; background: red; transform: rotate(15deg); transform-origin: right; }

.map-placeholder { width: 100%; height: 180px; background-color: #252525; background-image: url('https://upload.wikimedia.org/wikipedia/commons/8/80/World_map_-_low_resolution.svg'); background-size: cover; background-position: center; opacity: 0.3; border-radius: 8px; margin-bottom: 20px; position: relative; filter: invert(1); }
.map-dot { position: absolute; width: 12px; height: 12px; background: #f0b90b; border-radius: 50%; box-shadow: 0 0 10px rgba(240, 185, 11, 0.8); }
.geo-stats { display: flex; justify-content: space-around; text-align: center; }
.geo-item span { display: block; font-size: 12px; color: #fff; margin-bottom: 5px; font-weight: bold; }


/* ==========================================================================
   6. WIZARD DE CRIAÇÃO
   ========================================================================== */

/* Header Amarelo/Ouro */
.wizard-header { background: linear-gradient(90deg, #665c1c, #3d3d15); padding: 20px 30px; display: flex; justify-content: space-between; align-items: center; border-radius: 4px; margin-bottom: 20px; border-left: 5px solid #f0b90b; }
.wizard-header h1 { color: #fff; margin: 0; font-size: 24px; font-weight: 800; }
.progress-indicator { color: #fff; font-size: 14px; }
.progress-indicator .pill { border: 1px solid #fff; padding: 2px 8px; border-radius: 10px; margin-right: 5px; }

/* Steps */
.wizard-step { background: #181818; border: 1px solid #333; border-radius: 6px; margin-bottom: 15px; overflow: hidden; transition: all 0.3s ease; }
.step-header { padding: 15px 20px; display: flex; align-items: center; cursor: pointer; background: #1e1e1e; }
.step-num { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #666; color: #888; display: flex; justify-content: center; align-items: center; margin-right: 15px; font-weight: bold; }
.wizard-step.active .step-num { border-color: #2ecc71; color: #2ecc71; }
.step-title { font-size: 18px; font-weight: bold; color: #ccc; flex: 1; }
.wizard-step.active .step-title { color: #fff; }
.btn-toggle-step { background: none; border: none; color: #fff; font-size: 12px; font-weight: bold; cursor: pointer; text-transform: uppercase; }
.step-content { padding: 20px; border-top: 1px solid #333; display: none; }
.wizard-step.active .step-content { display: block; }
.step-desc { color: #aaa; margin-bottom: 20px; font-size: 14px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-row { display: flex; gap: 20px; }
.form-group.half { flex: 1; }
.distro-wizard-container label { display: block; color: #ccc; font-size: 13px; margin-bottom: 5px; font-weight: bold; }
.distro-wizard-container input[type="text"], .distro-wizard-container input[type="date"], .distro-wizard-container select { width: 100%; padding: 12px; background: #121212; border: 1px solid #444; border-radius: 4px; color: #fff; font-size: 14px; }
.distro-wizard-container input:focus { border-color: #f0b90b; outline: none; }
.input-with-icon { position: relative; }
.icon-lock { position: absolute; right: 10px; top: 10px; }
.info-box-green { background: rgba(46, 204, 113, 0.1); border: 1px solid #2ecc71; color: #2ecc71; padding: 10px; font-size: 12px; border-radius: 4px; margin-top: 5px; }
.btn-orange { background: #ff7f50; background: linear-gradient(90deg, #ff9f43, #ff6b6b); color: #fff; border: none; padding: 12px 30px; border-radius: 30px; font-weight: 800; text-transform: uppercase; font-size: 14px; cursor: pointer; box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3); }
.btn-orange:hover { filter: brightness(1.1); }
.advanced-section h4 { color: #888; cursor: pointer; border-bottom: 1px solid #333; padding-bottom: 5px; margin-top: 30px; }
.advanced-content { display: none; margin-top: 15px; }
.advanced-content.show { display: block; }
.empty-tracks-state { background: #252525; border: 1px dashed #555; padding: 20px; text-align: center; border-radius: 6px; color: #aaa; }
.upload-box-dashed { border: 2px dashed #555; padding: 30px; text-align: center; border-radius: 8px; }


/* ==========================================================================
   7. PAYWALL / BLOQUEIO DE SUBSCRIÇÃO
   ========================================================================== */

.distro-paywall-container { display: flex; justify-content: center; align-items: center; min-height: 60vh; background: #121212; padding: 20px; }
.paywall-content { background: #1e1e1e; border: 1px solid #333; border-radius: 12px; padding: 40px; max-width: 500px; width: 100%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5); position: relative; overflow: hidden; }
.paywall-content::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: linear-gradient(90deg, #f0b90b, #e67e22, #f0b90b); }
.pw-icon { font-size: 50px; margin-bottom: 20px; display: inline-block; animation: float 3s ease-in-out infinite; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
.paywall-content h1 { color: #fff; font-size: 28px; margin: 0 0 10px 0; font-weight: 800; }
.pw-subtitle { color: #aaa; font-size: 16px; margin-bottom: 30px; }
.pw-features { list-style: none; padding: 0; text-align: left; margin-bottom: 30px; background: #252525; padding: 20px; border-radius: 8px; }
.pw-features li { margin-bottom: 10px; color: #ddd; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.pw-features li:last-child { margin-bottom: 0; }
.pw-price-box { margin-bottom: 25px; }
.pw-price { font-size: 36px; font-weight: 800; color: #f0b90b; }
.pw-period { color: #666; font-size: 14px; }
.btn-gradient-glow { background: linear-gradient(90deg, #f0b90b, #e67e22); border: none; color: #fff; padding: 15px 30px; border-radius: 30px; font-weight: 800; text-transform: uppercase; font-size: 16px; cursor: pointer; width: 100%; box-shadow: 0 0 20px rgba(240, 185, 11, 0.3); transition: all 0.3s ease; }
.btn-gradient-glow:hover { box-shadow: 0 0 30px rgba(240, 185, 11, 0.5); transform: translateY(-2px); }
.pw-footer { margin-top: 20px; font-size: 12px; color: #555; }

/* Responsividade Geral */
/* ==========================================================================
   8. RESPONSIVIDADE MOBILE (DISTRIBUIÇÃO) - ESTILO APP PREMIUM
   ========================================================================== */
@media screen and (max-width: 768px) {

    /* ------------------------------------------------------------------
     * FIX:/* Mobile: cola às bordas, sem cantos em telemóveis pequenos.
     *
     * Causa: o contentor tinha margin lateral + border-radius, deixando
     * o fundo do tema WordPress visível por baixo.
     *
     * Solução: em mobile o contentor cola-se às bordas do ecrã (margin
     * lateral = 0) e perde o border-radius lateral. Como ele próprio
     * tem background escuro (#121212), cobre a largura toda.
     *
     * NOTA: NÃO mexemos no fundo do <body> do tema — só no contentor.
     *       O resto do site mantém a aparência original.
     * ------------------------------------------------------------------ */
    .distro-dashboard,
    .distro-analytics-container,
    .distro-wizard-container,
    .distro-single-view,
    .distro-list-container,
    .distro-paywall-container,
    .rmbz-wizard-v2 {
        padding: 20px 15px !important;        /* menos padding lateral também */
        margin: 0 !important;                  /* <-- cola às bordas */
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;           /* <-- sem cantos em mobile */
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;           /* sombra lateral não faz sentido sem margem */
        box-sizing: border-box !important;
    }

    /* Só prevenção de scroll horizontal acidental (não pinta o body). */
    html.rmbz-distro-active,
    body.rmbz-distro-active {
        overflow-x: hidden !important;
    }

    /* 2. Header do Wizard e Analytics empilham verticalmente e centram */
    .distro-header, .analytics-header, .wizard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    /* Corrige o header amarelo do Wizard no mobile */
    .wizard-header {
        background: transparent;
    }
    
    /* 3. Wizard Steps - Melhorias Mobile */
    .rmbz-w-step-head {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 15px;
    }
    
    .rmbz-w-step-title {
        min-width: 0;
        flex: 1;
    }
    
    .rmbz-w-step-title small {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.3;
    }
    
    .rmbz-w-step-status {
        flex-shrink: 0;
    }
    
    /* 4. Cards de Tipo de Lançamento - Mobile */
    .rmbz-w-type-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .rmbz-w-type-card {
        padding: 20px 15px;
        text-align: center;
    }
    
    /* 5. Grid de Inputs - Mobile */
    .rmbz-w-row.two {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 6. Track List - Mobile */
    .rmbz-track-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .rmbz-track-info {
        text-align: center;
    }
    
    .rmbz-track-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .rmbz-track-actions button {
        flex: 1;
        min-width: 100px;
    }
    
    /* 7. Cover Upload - Mobile */
    .rmbz-cover-wrap {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .rmbz-cover-info {
        text-align: center;
    }
    
    /* 8. Footer Actions - Mobile */
    .rmbz-w-step-foot {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .rmbz-w-btn {
        width: 100%;
        text-align: center;
        padding: 15px 20px;
        font-size: 14px;
    }
    
    /* 9. Platform Selection - Mobile */
    .rmbz-s2-dsp {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .rmbz-s2-dsp input {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    /* 10. Tabs - Mobile */
    .rmbz-tm-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rmbz-tm-tab {
        flex-shrink: 0;
        padding: 12px 16px;
    }
    
    /* 11. Form Rows - Mobile */
    .form-row.two, .distro-filters {
        flex-direction: column;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 12. Release Actions - Mobile */
    .release-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .release-actions button,
    .release-actions a {
        width: 100%;
        text-align: center;
    }
    
    /* 13. Badges e Status - Mobile */
    .badge-done, .badge-current, .badge-locked {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    /* 14. Tables - Mobile */
    .responsive-table {
        font-size: 12px;
    }
    
    .responsive-table td,
    .responsive-table th {
        padding: 8px 5px;
    }
    
    /* 15. Modal - Mobile */
    .rmbz-tm-modal {
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .rmbz-tm-modal-content {
        padding: 20px 15px;
    }
    
    /* 16. Wizard Header - Mobile Fix */
    .wizard-header h1 { 
        font-size: 20px; 
        text-align: center;
    }

    /* 3. Stat cards (Dashboard): 1 coluna para não esmagar os números */
    .stats-grid { 
        grid-template-columns: 1fr; 
        gap: 15px; 
    }

    /* 4. A Lista de Distribuição (Discografia) */
    .release-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        text-align: center;
        padding: 15px;
    }
    
    .release-cover {
        width: 100%;
        max-width: 180px; /* Capa maior e centrada no telemóvel */
        height: auto;
        aspect-ratio: 1/1;
        margin: 0 auto 10px auto; 
    }

    .release-main-info {
        min-width: 100%;
        /* min-width:0 não funciona no mesmo contexto que min-width:100%, mas
           o que precisamos aqui é que filhos com texto possam respeitar a
           largura — usamos overflow-wrap no .release-title directamente
           (já adicionado na regra base) e garantimos que o container não
           tem width:auto que causa overflow. */
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden; /* defesa contra qualquer filho que ainda tente sair */
        /* Forçar wrapping em todos os filhos directos (links que envolvem o
           título não tinham display:block, agora forçamos para que a quebra
           do <h3> dentro respeite a largura do contentor). */
        width: 100%;
    }

    /* Links dentro do main-info (envolvem h3, status badge, etc) precisam ser
       block-level para o conteúdo respeitar a largura. Sem isto, o <a> mantém
       display:inline e pode causar comportamento errático em flex/grid. */
    .release-main-info > a {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .release-title {
        /* Reforça quebra de títulos longos em mobile, e reduz tamanho
           para caber melhor em telas pequenas. Várias propriedades para
           cobrir todos os browsers e situações: overflow-wrap funciona em
           browsers modernos; word-break:break-word é fallback. */
        font-size: 16px;
        line-height: 1.3;
        overflow-wrap: anywhere !important;
        word-wrap: break-word !important;
        word-break: normal !important;
        /* Garantir que o título nunca ultrapassa o seu contentor */
        max-width: 100%;
        box-sizing: border-box;
        /* Anular qualquer white-space:nowrap herdado */
        white-space: normal !important;
    }

    /* Detalhes da música (UPC, Data, etc.) numa grelha arrumada */
    .release-meta-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: left;
        background: #1a1a1a;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #333;
    }

    /* Ações na lista (Botões DISTRIBUIR, etc.) a ocupar 100% */
    .release-actions {
        min-width: 100%;
        align-items: stretch;
        border-top: 1px solid #333;
        padding-top: 15px;
        gap: 10px;
    }
    .release-actions button,
    .release-actions a {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* 5. Grelha Lançamentos Rápidos (Cards com capa) */
    .releases-grid { 
        grid-template-columns: repeat(2, 1fr); /* 2 capas lado a lado */
        gap: 15px; 
    }

    /* 6. Inputs do Wizard (Passo 1, 2, 3) e Filtros */
    .form-row.two, .distro-filters { 
        flex-direction: column;
        grid-template-columns: 1fr; 
        gap: 15px;
    }
    
    .filter-actions { 
        flex-direction: column; 
        gap: 10px; 
    }
    .filter-actions button { width: 100%; }

    /* 7. Botões e Ações de Rodapé (Footer) a 100% */
    .footer-actions, .rmbz-w-step-foot { 
        flex-direction: column; 
        gap: 12px; 
        align-items: stretch;
    }
    .footer-actions a, .footer-actions button, .rmbz-w-btn { 
        width: 100%; 
        box-sizing: border-box; 
        text-align: center; 
    }
}
/* ============================================================================
   HOTFIX MOBILE FINAL — Distribuição ocupa a tela do telefone
   Corrige temas WordPress que empurram o shortcode para a direita ou limitam
   a largura do conteúdo no mobile.
   ============================================================================ */
@media (max-width: 768px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        /* [BUGFIX 1.5.9] Removido background:#121212 que pintava o site
           todo de preto no mobile, sobrepondo o tema WordPress. */
    }

    body.rmbz-distro-mobile,
    body.rmbz-distro-mobile #page,
    body.rmbz-distro-mobile .site,
    body.rmbz-distro-mobile .site-content,
    body.rmbz-distro-mobile .content-area,
    body.rmbz-distro-mobile .site-main,
    body.rmbz-distro-mobile main,
    body.rmbz-distro-mobile article,
    body.rmbz-distro-mobile .entry,
    body.rmbz-distro-mobile .entry-content,
    body.rmbz-distro-mobile .wp-site-blocks,
    body.rmbz-distro-mobile .wp-block-post-content,
    body.rmbz-distro-mobile .wp-block-group,
    body.rmbz-distro-mobile .container,
    body.rmbz-distro-mobile .wrap,
    body.rmbz-distro-mobile .ast-container,
    body.rmbz-distro-mobile .elementor,
    body.rmbz-distro-mobile .elementor-section,
    body.rmbz-distro-mobile .elementor-container,
    body.rmbz-distro-mobile .elementor-widget-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
        /* [BUGFIX 1.5.9] Removido background-color:#121212 que pintava
           wrappers do tema (#page, .site, main, .entry-content, .elementor*)
           de preto, escondendo header/menu/footer do tema. */
    }

    body.rmbz-distro-mobile .entry-title,
    body.rmbz-distro-mobile .page-title,
    body.rmbz-distro-mobile h1.entry-title {
        /* [BUGFIX 1.5.9] Removido color:#fff e background:#121212 para não
           sobrepor o estilo do título da página definido pelo tema. */
        margin: 0 !important;
        padding: 18px 16px 10px 16px !important;
        font-size: clamp(28px, 8vw, 42px) !important;
        line-height: 1.12 !important;
        box-sizing: border-box !important;
    }

    /* [REFACTOR 1.5.11] Mobile agora segue a mesma abordagem do frontend.css
       (página Minha Conta): container respeita a coluna que o tema dá, sem
       esticar para 100vw. Isso elimina o efeito visual de "saltar" que se
       via quando o JS adicionava a classe .rmbz-distro-mobile tarde demais
       (o utilizador via primeiro o full-bleed do desktop e depois o mobile
       a ajustar-se). Agora width:auto + margin:20px auto = comportamento
       natural, previsível, idêntico ao .onemz-artist-dashboard. */
    .distro-dashboard,
    .distro-analytics-container,
    .distro-wizard-container,
    .distro-single-view,
    .distro-list-container,
    .distro-paywall-container,
    .rmbz-wizard-v2,
    .rmbz-fullbleed {
        display: block !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 20px auto !important;
        padding: 20px 15px !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        background-color: #121212 !important;
    }

    .distro-header,
    .analytics-header,
    .wizard-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        margin-bottom: 22px !important;
    }

    .distro-header h1,
    .analytics-header h1,
    .wizard-header h1 {
        font-size: 28px !important;
        line-height: 1.15 !important;
        text-align: left !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    .header-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .header-actions .onemz-btn {
        width: 100% !important;
        min-width: 0 !important;
        justify-content: center !important;
        padding: 10px 8px !important;
        font-size: 12px !important;
        white-space: normal !important;
        box-sizing: border-box !important;
    }

    .stat-card,
    .promo-banner,
    .account-card,
    .release-item,
    .rmbz-w-card,
    .rmbz-tm-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .promo-banner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    .promo-banner .btn-outline {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .artist-accounts-grid,
    .stats-grid,
    .releases-grid {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .artist-accounts-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    body.rmbz-distro-mobile .rmbz-distro-mobile-parent {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
        /* [BUGFIX 1.5.9] Removido background-color:#121212 que pintava os
           ancestrais (até 8 níveis) do container de preto, escondendo o
           tema. A libertação de largura/margin/padding fica, é inofensiva. */
    }
}
