/* assets/css/account-page.css */
/* Estilos para o Painel do Artista (Minha Conta - 1MZ For Artists) */

/* --- CONTAINER PRINCIPAL --- */
.my-account-container, .onemz-artist-dashboard {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background-color: #1e1e1e;
    color: #f0f0f0;
    border-radius: 12px;
    border: 1px solid #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.my-account-container h2, .onemz-artist-dashboard h2 {
    margin-top: 0;
    font-size: 24px;
    color: #fff;
    font-weight: 700;
}

.logout-link {
    color: #e74c3c;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #e74c3c;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.logout-link:hover {
    background-color: #e74c3c;
    color: #fff;
}

/* --- SECÇÕES DA CONTA --- */
.account-section {
    margin-top: 25px;
    padding: 20px;
    border-radius: 8px;
    background-color: #2a2a2a;
    border: 1px solid #333;
}

.account-section h3 {
    margin-top: 0;
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
}

/* --- CARTEIRA E SALDO --- */
.wallet-balance {
    background-color: #2c3e50; /* Azul escuro */
    text-align: center;
    border: none;
}

.wallet-balance h3 {
    font-size: 14px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wallet-balance .balance-amount {
    font-size: 36px;
    font-weight: 800;
    color: #f0b90b; /* Amarelo */
    margin: 10px 0 0 0;
    line-height: 1;
}

/* --- TÍTULOS DAS ABAS (FORÇADO COM !IMPORTANT) --- */
/* Garante que "Projetos Aprovados" fique igual ao Saldo */
.my-account-container .account-tab-content h3 {
    color: #f0b90b !important;    /* Amarelo 1MZ */
    font-size: 32px !important;   /* Grande */
    font-weight: 800 !important;  /* Negrito forte */
    margin-top: 30px;
    margin-bottom: 20px;
    line-height: 1.2;
    text-transform: none !important;
    border-bottom: none !important;
}

/* --- CARTÕES DE PROJETO (CONTRATOS) --- */
.project-card {
    background-color: #222;
    border-left: 4px solid #2ecc71; /* Verde aprovação */
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.project-card h4 {
    margin: 0;
    color: #f0b90b; /* Título do cartão também amarelo */
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.project-card hr {
    border: 0;
    border-top: 1px solid #444;
    margin: 15px 0;
}

.project-card h5 {
    color: #ccc;
    margin-bottom: 10px;
    margin-top: 0;
    font-size: 14px;
    text-transform: uppercase;
}

/* Área de Roteiro */
.script-viewer {
    background: #111;
    padding: 15px;
    color: #ddd;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
}

/* --- HISTÓRICO DE FEEDBACK --- */
.feedback-history-box {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    color: #ccc;
    line-height: 1.5;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    margin-bottom: 15px;
}

.feedback-history-box p {
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2a2a;
}

.feedback-history-box p:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.feedback-history-box strong {
    color: #f0b90b;
    font-weight: bold;
}

/* Formulários dentro do cartão */
.project-card textarea {
    width: 100%;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    border-radius: 4px;
    padding: 10px;
    margin-top: 5px;
    box-sizing: border-box;
    font-family: inherit;
}

.project-card textarea:focus {
    border-color: #f0b90b;
    outline: none;
}

/* --- TABELAS (HISTÓRICO E SUBMISSÕES) --- */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th, .history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
    font-size: 14px;
}

.history-table th {
    font-weight: bold;
    color: #888;
    text-transform: uppercase;
    font-size: 12px;
}

.history-table td {
    color: #ddd;
}

/* Badges de Estado */
.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}
.status-aprovado { color: #2ecc71; background: rgba(46, 204, 113, 0.1); border: 1px solid #2ecc71; }
.status-rejeitado { color: #e74c3c; background: rgba(231, 76, 60, 0.1); border: 1px solid #e74c3c; }
.status-pendente { color: #f0b90b; background: rgba(240, 185, 11, 0.1); border: 1px solid #f0b90b; }

/* --- FORMULÁRIO DE LOGIN E REGISTO --- */
.login-form {
    max-width: 400px;
    margin: 30px auto;
}

.login-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
}

.login-form input[type="tel"], 
.login-form input[type="text"], 
.login-form input[type="password"],
.login-form select {
    width: 100%;
    padding: 12px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.login-form input:focus, .login-form select:focus {
    border-color: #f0b90b;
    outline: none;
}

/* Estilo específico para o ID de transação */
input[name="reg_transaction_id"] {
    text-transform: uppercase;
    font-family: monospace;
    letter-spacing: 1px;
    color: #f0b90b;
    font-weight: bold;
}

.login-form .phone-input-group {
    display: flex;
    align-items: center;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 0 12px;
}

.login-form .phone-input-group:focus-within {
    border-color: #f0b90b;
}

.login-form .phone-input-group .country-code {
    color: #aaa;
    margin-right: 10px;
    font-weight: bold;
    border-right: 1px solid #555;
    padding-right: 10px;
}

.login-form .phone-input-group input {
    border: none;
    background: transparent;
    padding: 12px 0;
}

.login-form .phone-input-group input:focus {
    outline: none;
}

.login-form button {
    width: 100%;
    margin-top: 25px;
    padding: 16px;
    background-color: #f0b90b;
    color: #1e1e1e;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.login-form button:hover {
    opacity: 0.9;
}

.login-error {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid #e74c3c;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* --- ANIMAÇÃO DE PAGAMENTO --- */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* --- ABAS DE NAVEGAÇÃO --- */
.account-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #333;
    margin-top: 30px;
    margin-bottom: 20px;
}

.tab-link {
    padding: 12px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: #aaa;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-link:hover {
    color: #fff;
}

.tab-link.active {
    color: #f0b90b;
    border-bottom-color: #f0b90b;
}

.account-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    /* [BUGFIX 1.5.18] max-width + min-width:0 para evitar que filhos
       com textos longos (ex. "Levantamento de Royalties (M-Pesa:...)")
       empurrem o container para fora do viewport no mobile. */
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.account-tab-content.active {
    display: block;
}

/* --- CAIXA DE CONVITE --- */
.referral-box {
    background-color: #222;
    border: 1px dashed #555;
    padding: 15px;
}

.referral-code-wrapper input {
    width: 100%;
    text-align: center;
    background: #111;
    border: 1px solid #444;
    color: #f0b90b;
    padding: 10px;
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: bold;
    border-radius: 4px;
    box-sizing: border-box;
}

/* --- MODAL (USADO PARA LEVANTAMENTOS E DEPÓSITOS) --- */
.tickets-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
}

.tickets-modal-content {
    background-color: #1e1e1e;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #333;
    width: 100%;
    max-width: 500px;
    position: relative;
    color: #f0f0f0;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
}

/* Botões Genéricos */
.button-view-tickets, .button-primary, .button-secondary {
    padding: 10px 15px;
    border-radius: 6px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    text-align: center;
}

.button-view-tickets { background-color: #f0b90b; color: #1e1e1e; }
.button-primary { background-color: #f0b90b; color: #1e1e1e; }
.button-secondary { background-color: #555; color: #fff; }

/* --- RESPONSIVIDADE (MOBILE) --- */
@media screen and (max-width: 600px) {
    .my-account-container, .onemz-artist-dashboard {
        padding: 20px;
        margin: 20px 10px;
        /* [BUGFIX 1.5.18] Evitar scroll horizontal no mobile causado por
           tabelas/cards com conteúdo longo que escapavam do viewport. */
        max-width: calc(100% - 20px);
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .wallet-balance .balance-amount {
        font-size: 28px;
    }
    
    .tab-link {
        padding: 10px 15px;
        font-size: 13px;
        flex-grow: 1;
        text-align: center;
    }

    .responsive-table thead { display: none; }
    .responsive-table tr { display: block; border: 1px solid #333; margin-bottom: 15px; border-radius: 8px; padding: 10px; }
    /* [BUGFIX 1.5.18] Textos longos nas transações (ex. "Levantamento de
       Royalties (M-Pesa: 849392636) — $4.00 USD convertidos...") esticavam
       o td para fora do viewport. Em flex, o filho por default tem
       min-width:auto, o que permite-lhe crescer além do container se o
       texto não tiver espaços para quebrar. A solução é:
         • min-width:0        — dá permissão ao flex para encolher o td
         • flex-wrap:wrap     — quando label+valor não cabem, vai para 2 linhas
         • overflow-wrap:anywhere — quebra palavras longas (URLs, IDs longos)
         • word-break:break-word — fallback para browsers mais antigos
       Também damos max-width:100% ao td para que nunca ultrapasse o tr pai. */
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 4px 10px;
        border: none;
        padding: 5px 0;
        font-size: 13px;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .responsive-table td::before { content: attr(data-label); font-weight: bold; color: #888; margin-right: 10px; flex-shrink: 0; }
    /* Quando não há data-label (legacy), esconder o ::before vazio para
       evitar espaço em branco esquisito à esquerda. */
    .responsive-table td:not([data-label])::before { content: none; }
    /* Também prevenir a própria tabela de forçar scroll horizontal no pai */
    .responsive-table { max-width: 100%; table-layout: fixed; }
}