/**
 * assets/css/frontend.css
 *
 * Tema Premium Minimalista: Preto e Branco, Dark Mode.
 * Estilos principais para o front-end do 1MZ For Artists.
 */

/* --- VARIÁVEIS DO TEMA --- */
:root {
    --bg-main: #0a0a0a;
    --bg-secondary: #141414;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-color: #2a2a2a;
    --accent-color: #ffffff;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.5);
    --radius-main: 10px;
    --radius-sm: 6px;
}

/* --- TEMA GERAL --- */
.onemz-artist-dashboard, .onemz-login-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    box-sizing: border-box;
}

/* --- CONTAINER PRINCIPAL --- */
.onemz-artist-dashboard {
    max-width: 900px;
    margin: 40px auto;
    background-color: var(--bg-main);
    border-radius: var(--radius-main);
    border: 1px solid var(--border-color);
    padding: 35px;
    box-shadow: var(--shadow-soft);
}

/* Títulos */
.onemz-artist-dashboard h2 {
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--text-main);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.onemz-artist-dashboard h3 {
    font-size: 16px;
    color: var(--text-main);
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.onemz-artist-dashboard p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
}

/* --- TOAST NOTIFICATIONS (UX) --- */
#rmbz-toast-container { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 9999; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    pointer-events: none;
}

.rmbz-toast { 
    background: #1a1a1a; 
    color: #ffffff; 
    padding: 15px 20px; 
    border-radius: var(--radius-sm); 
    border: 1px solid #333333; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); 
    opacity: 0; 
    transform: translateX(50px); 
    transition: all 0.3s ease; 
    font-size: 14px; 
    display: flex;
    align-items: center;
    pointer-events: auto;
}

.rmbz-toast.show { 
    opacity: 1; 
    transform: translateX(0); 
}

.rmbz-toast span {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cores de Estado dos Toasts (Apenas Ícones ou Bordas se necessário) */
.rmbz-toast.success { border-left: 4px solid var(--text-main); }
.rmbz-toast.error { border-left: 4px solid #555555; }
.rmbz-toast.info { border-left: 4px solid var(--text-muted); }

/* --- CAIXAS DE STATUS (Subscrição) --- */
.status-box { 
    padding: 25px; 
    border-radius: var(--radius-sm); 
    margin-bottom: 25px; 
    text-align: center; 
    border: 1px solid var(--border-color); 
    background-color: var(--bg-secondary); 
}

.status-box.active { border-color: #444; }
.status-box.blocked { border-color: #333; }

.status-box h3 { 
    margin-top: 0; 
    font-size: 18px; 
    margin-bottom: 5px; 
    color: var(--text-muted); 
}

.status-box .price-tag { 
    font-size: 36px; 
    font-weight: 700; 
    color: var(--text-main); 
    display: block; 
    margin: 10px 0; 
}

/* --- ABAS DE NAVEGAÇÃO --- */
/* [DS 1.5.41] CSS antigo das tabs movido para o design system
 * (assets/css/03-components.css §4.5). As classes .account-tabs,
 * .tab-link e .account-tab-content continuam a funcionar via aliases
 * no design system — JS de switching não precisa de mudanças.
 *
 * Original mantido aqui apenas para fallback se o DS não carregar:
 */
.account-tabs:not(.rmbz-tabs) { 
    margin-top: 30px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    gap: 20px; 
    margin-bottom: 25px; 
}

.tab-link:not(.rmbz-tab) { 
    background: none; 
    border: none; 
    color: var(--text-muted); 
    padding: 10px 0; 
    cursor: pointer; 
    font-weight: 500; 
    font-size: 14px; 
    transition: color 0.2s; 
    position: relative; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-link:not(.rmbz-tab):hover { 
    color: var(--text-main); 
}

.tab-link:not(.rmbz-tab).active { 
    color: var(--text-main); 
}

.tab-link:not(.rmbz-tab).active::after { 
    content: ''; 
    position: absolute; 
    bottom: -1px; 
    left: 0; 
    width: 100%; 
    height: 2px; 
    background-color: var(--accent-color); 
}

/* --- CONTEÚDO DAS ABAS (fallback) --- */
.account-tab-content:not(.rmbz-tab-content) { 
    display: none; 
    animation: fadeIn 0.3s ease; 
}

.account-tab-content:not(.rmbz-tab-content).active { 
    display: block; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* --- TABELAS GERAIS (Responsive) --- */
.history-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}

.history-table th, .history-table td { 
    padding: 15px; 
    text-align: left; 
    border-bottom: 1px solid var(--border-color); 
    color: var(--text-main); 
    font-size: 14px; 
}

.history-table th { 
    font-weight: 600; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    font-size: 12px; 
}

/* Transformação para Mobile nas Tabelas */
@media screen and (max-width: 768px) {
    .responsive-table thead { display: none; }
    
    .responsive-table tr {
        display: block;
        background: var(--bg-secondary);
        margin-bottom: 15px;
        border-radius: var(--radius-sm);
        padding: 15px;
        border: 1px solid var(--border-color);
    }
    
    /* [BUGFIX 1.5.18] Textos longos (ex. "Levantamento de Royalties
       (M-Pesa: 849392636) — $4.00 USD convertidos...") expandiam o td
       para fora do viewport. Ver account-page.css para explicação completa. */
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px 10px;
        border-bottom: 1px solid var(--border-color);
        padding: 10px 0;
        font-size: 14px;
        text-align: right;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    
    .responsive-table td:last-child { border-bottom: none; }
    
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 11px;
        margin-right: 15px;
        text-align: left;
        flex-shrink: 0;
    }
    /* Quando não há data-label (legacy), esconder ::before vazio */
    .responsive-table td:not([data-label])::before { content: none; }

    .responsive-table { max-width: 100%; table-layout: fixed; }
}

/* --- FORMULÁRIOS E INPUTS --- */
.onemz-artist-dashboard label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 500; 
    color: var(--text-muted); 
    font-size: 13px; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

.onemz-artist-dashboard input[type="text"], 
.onemz-artist-dashboard input[type="number"], 
.onemz-artist-dashboard input[type="email"], 
.onemz-artist-dashboard input[type="tel"], 
.onemz-artist-dashboard input[type="password"], 
.onemz-artist-dashboard select, 
.onemz-artist-dashboard textarea { 
    width: 100%; 
    padding: 14px; 
    background-color: var(--bg-secondary); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-sm); 
    color: var(--text-main); 
    font-size: 15px; 
    box-sizing: border-box; 
    transition: all 0.2s; 
}

.onemz-artist-dashboard input:focus, 
.onemz-artist-dashboard select:focus, 
.onemz-artist-dashboard textarea:focus { 
    border-color: #555555; 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05); 
}

/* Upload de Ficheiro */
.onemz-artist-dashboard input[type="file"] { 
    padding: 10px; 
    background-color: var(--bg-secondary); 
    border: 1px dashed #444444; 
    color: var(--text-muted); 
    cursor: pointer;
}

.onemz-artist-dashboard input[type="file"]::file-selector-button { 
    background-color: #333333; 
    color: #ffffff; 
    border: none; 
    padding: 8px 16px; 
    border-radius: 4px; 
    margin-right: 15px; 
    cursor: pointer; 
    transition: background 0.2s; 
    font-size: 13px; 
    font-weight: 600;
}

.onemz-artist-dashboard input[type="file"]::file-selector-button:hover { 
    background-color: #555555; 
}

/* --- BOTÕES --- */
.onemz-btn { 
    display: inline-block; 
    width: 100%; 
    padding: 15px; 
    border: none; 
    border-radius: var(--radius-sm); 
    font-size: 15px; 
    font-weight: 600; 
    cursor: pointer; 
    text-align: center; 
    text-decoration: none; 
    transition: all 0.2s; 
    box-sizing: border-box; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary { 
    background-color: var(--accent-color); 
    color: #000000; 
}

.btn-primary:hover { 
    opacity: 0.9; 
    transform: translateY(-1px); 
}

.btn-secondary { 
    background-color: #333333; 
    color: #ffffff; 
}

.btn-secondary:hover { 
    background-color: #444444; 
}

.btn-outline {
    background: transparent;
    border: 1px solid #555555;
    color: #cccccc;
}

.btn-outline:hover {
    background-color: #222222;
    color: #ffffff;
    border-color: #777777;
}

/* --- PROJECT CARD (Contratos) --- */
.project-card { 
    background: var(--bg-secondary); 
    border-radius: var(--radius-sm); 
    padding: 25px; 
    margin-bottom: 20px; 
    border: 1px solid var(--border-color); 
}

/* --- MODAIS (Popups) --- */
.tickets-modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(4px); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 10000; 
    padding: 20px; 
    box-sizing: border-box;
    opacity: 0;
    animation: fadeInModal 0.3s forwards;
}

@keyframes fadeInModal {
    to { opacity: 1; }
}

.tickets-modal-content { 
    background: var(--bg-main); 
    padding: 35px; 
    border-radius: var(--radius-main); 
    width: 100%; 
    max-width: 450px; 
    border: 1px solid var(--border-color); 
    position: relative; 
    color: var(--text-main);
}

.modal-close-btn { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    background: none; 
    border: none; 
    color: var(--text-muted); 
    font-size: 28px; 
    cursor: pointer; 
    transition: color 0.2s; 
    line-height: 1;
}

.modal-close-btn:hover { 
    color: #ffffff; 
}

/* --- BUDGET TABLE (Orçamento Limpo) --- */
.budget-table { 
    width: 100%; 
    border-collapse: collapse; 
    color: var(--text-main); 
    font-size: 14px; 
    border: none;
}

.budget-table td { 
    padding: 10px 0; 
    border-bottom: 1px solid var(--border-color); 
    border-top: none;
    border-left: none;
    border-right: none;
}

.budget-table tr:last-child td { 
    border-bottom: none; 
}

.budget-table .total-row td { 
    border-top: 1px solid #444444; 
    font-weight: 600; 
    font-size: 16px; 
    padding-top: 15px; 
    color: #ffffff;
}

/* --- AVISOS (Compatibilidade) --- */
.rmbz-login-warning, .rmbz-notice {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* --- RESPONSIVIDADE EXTRA --- */

/* Reset de padding/margin do tema WordPress em mobile */
@media screen and (max-width: 600px) {
    body.page .entry-content,
    body.page .site-content,
    body.page .wp-block-group,
    body.page .wp-block-post-content,
    body.page main,
    body.page article,
    body.page .hentry {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media screen and (max-width: 600px) {
    .onemz-artist-dashboard { 
        margin: 0; 
        padding: 20px 16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        min-height: 100vh;
    }
    
    .onemz-artist-dashboard h2 {
        font-size: 20px;
    }

    .status-box .price-tag { 
        font-size: 28px; 
    }

    .onemz-btn { 
        padding: 12px; 
        font-size: 14px; 
    }

    /* [DS 1.5.41] Mobile override antigo das tabs — agora gerido pelo
     * design system. Mantido apenas para fallback (sem .rmbz-tabs). */
    .account-tabs:not(.rmbz-tabs) { 
        flex-wrap: wrap; 
        gap: 10px; 
        border-bottom: none;
    }
    
    .tab-link:not(.rmbz-tab) { 
        flex: 1; 
        text-align: center; 
        background: var(--bg-secondary); 
        border-radius: 4px; 
        padding: 10px; 
        font-size: 12px;
    }
    
    .tab-link:not(.rmbz-tab).active::after { 
        display: none; 
    }
    
    .tab-link:not(.rmbz-tab).active { 
        background: #333333; 
        color: #ffffff; 
    }
}