/* assets/css/account-page.css */
/* Estilos para a página "Minha Conta" do utilizador */

.my-account-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: #1e1e1e;
    color: #f0f0f0;
    border-radius: 12px;
    border: 1px solid #333;
}

.my-account-container h2 {
    margin-top: 0;
    font-size: 28px;
    color: #fff;
}

.logout-link {
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
}
.logout-link:hover {
    color: #f0b90b;
}

.account-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

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

.wallet-balance {
    background-color: #2c3e50; /* Um azul escuro para destaque */
    padding: 25px 20px;
    border-radius: 8px;
    text-align: center;
    border-top: none;
}

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

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

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

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

.history-table td {
    font-size: 15px;
    color: #ddd;
}

.history-table .ticket-number {
    font-family: monospace, sans-serif;
    font-weight: bold;
    font-size: 16px;
    color: #f0b90b;
}

.history-table .amount {
    font-weight: bold;
    font-family: monospace, sans-serif;
}

/* Cores para os tipos de transação */
.transaction-purchase .amount, .transaction-withdrawal .amount, .transaction-partial_purchase .amount {
    color: #e74c3c; /* Vermelho para saídas */
}
.transaction-refund_cancelled .amount, .transaction-deposit .amount, .transaction-refund_deleted .amount, .transaction-refund_rejected .amount, .transaction-referral_bonus .amount {
    color: #2ecc71; /* Verde para entradas */
}

/* Estilos para o formulário de login na página da conta */
.login-form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 8px;
    color: #ccc;
}

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

.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;
}

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

/* Estilos para a secção de bilhetes pendentes */
.history-table .ticket-number.pending {
    color: #888;
    font-style: italic;
    border: 1px dashed #555;
    background-color: #2a2a2a;
    padding: 5px 8px;
}

.pending-tickets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-note {
    font-size: 13px;
    color: #999;
    margin-top: 15px;
    text-align: center;
    background-color: rgba(240, 185, 11, 0.05);
    border: 1px solid #333;
    padding: 10px;
    border-radius: 8px;
}

/* Estilos para o temporizador */
.reservation-timer {
    display: flex;
    align-items: center;
    gap: 10px;
}
.timer-display {
    font-weight: bold;
    color: #f0b90b;
    background-color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 16px;
}
.extend-time-btn {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}
.extend-time-btn:hover {
    background-color: #34495e;
}
.extend-time-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* Estilos para o botão "Ver Bilhetes" */
.button-view-tickets {
    background-color: #f0b90b;
    color: #1e1e1e;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    border: none;
    cursor: pointer;
}
.button-view-tickets:hover {
    opacity: 0.9;
}

/* Estilos para o Modal (Pop-up) de Bilhetes */
.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: 25px 30px;
    border-radius: 12px;
    border: 1px solid #333;
    width: 100%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    /* --- INÍCIO DA CORREÇÃO --- */
    color: #f0f0f0; /* Define a cor do texto padrão para claro */
    /* --- FIM DA CORREÇÃO --- */
}

.tickets-modal-content h3 {
    margin-top: 0;
    color: #fff;
    text-align: center;
}

.modal-total-spent {
    font-size: 14px;
    color: #aaa;
    margin-top: -15px;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

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

.modal-search-wrapper {
    margin-bottom: 20px;
}

#modal-ticket-search {
    width: 100%;
    padding: 12px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
}
#modal-ticket-search:focus {
    outline: none;
    border-color: #f0b90b;
}

#modal-tickets-list {
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#modal-tickets-list .numero-bilhete {
    background-color: #333;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-family: monospace, sans-serif;
    font-size: 16px;
    color: #f0b90b;
    display: inline-block;
}

/* ========================================= */
/* ESTILOS PARA TABELAS RESPONSIVAS (MÓVEL) */
/* ========================================= */

@media screen and (max-width: 768px) {
    .responsive-table thead {
        display: none; /* Esconde o cabeçalho original em ecrãs pequenos */
    }

    .responsive-table tr {
        display: block;
        border: 1px solid #333;
        border-radius: 8px;
        margin-bottom: 20px;
        padding: 15px;
    }

    .responsive-table td {
        display: flex; /* Usa flexbox para alinhar label e conteúdo */
        justify-content: space-between; /* Coloca o label à esquerda e o conteúdo à direita */
        align-items: center;
        text-align: right;
        padding: 10px 0;
        border-bottom: 1px dotted #333;
    }

    .responsive-table tr td:last-child {
        border-bottom: none; /* Remove a borda do último item */
    }

    .responsive-table td::before {
        content: attr(data-label); /* Pega o texto do atributo data-label */
        font-weight: bold;
        color: #aaa;
        text-align: left;
        padding-right: 15px;
    }

    /* Ajustes para conteúdo específico */
    .responsive-table td .pending-tickets-grid {
        justify-content: flex-end; /* Alinha os números à direita */
        max-width: 60%; /* Evita que a grelha quebre para a linha de baixo */
    }
}

/* ... (todo o seu CSS existente continua aqui) ... */

/* ========================================= */
/* ESTILOS PARA O NOVO MENU DE ABAS (TABS)  */
/* ========================================= */

.account-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    margin-top: 40px;
}

.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    color: #aaa;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px; /* Alinha a borda de baixo com a borda do container */
    transition: all 0.2s ease-in-out;
}

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

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

.account-tab-content {
    display: none; /* Esconde todas as abas por padrão */
    padding-top: 20px;
}

.account-tab-content.active {
    display: block; /* Mostra apenas a aba ativa */
}

/* Esconde os títulos H3 que agora estão nos botões */
.account-tab-content h3 {
    display: none;
}

/* ================================================== */
/* CSS PARA ABAS RESPONSIVAS NA PÁGINA "MINHA CONTA" */
/* ================================================== */

/* O container que envolve as abas */
.account-tabs {
    display: flex;             /* Ativa o layout flexível */
    flex-wrap: wrap;           /* Permite que os itens quebrem para a linha seguinte */
    justify-content: center;   /* Centra as abas no espaço disponível */
    border-bottom: 1px solid #333;
    margin-bottom: 25px;
    position: relative;        /* Necessário para o z-index funcionar */
    z-index: 10;
}

/* Estilo para cada item do menu (aba) */
.account-tabs a, 
.account-tabs button { /* Funciona para links <a> ou botões <button> */
    padding: 12px 15px;
    margin: 0 5px 5px 5px; /* Adiciona um pequeno espaçamento */
    text-decoration: none;
    color: #aaa;
    font-weight: bold;
    font-size: 15px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent; /* Borda inferior para indicar estado ativo */
    transition: all 0.2s ease-in-out;
}

/* Estilo para a aba ativa ou quando o rato está por cima */
.account-tabs a.active,
.account-tabs button.active,
.account-tabs a:hover,
.account-tabs button:hover {
    color: #f0b90b; /* Amarelo/Dourado */
    border-bottom-color: #f0b90b;
}

/* ========================================= */
/* --- NOVO: ESTILOS DA CAIXA DE VENCEDOR --- */
/* ========================================= */
.winner-notification-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background-color: rgba(46, 204, 113, 0.05); /* Fundo verde muito claro */
    border: 1px solid #2ecc71; /* Borda verde */
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
}
.winner-notification-box .winner-icon {
    font-size: 30px;
    line-height: 1;
    margin-top: -3px;
}
.winner-notification-box .winner-text {
    flex: 1;
}
.winner-notification-box .winner-text strong {
    font-size: 18px;
    color: #2ecc71; /* Texto principal verde */
    display: block;
    margin-bottom: 5px;
}
.winner-notification-box .winner-text p {
    margin: 0 0 5px 0;
    color: #f0f0f0;
    font-size: 15px;
    line-height: 1.5;
}
.winner-notification-box .winner-text p strong {
    font-size: 15px;
    display: inline;
    color: #f0b90b; /* Amarelo para o número do bilhete */
    font-family: monospace;
}

/* ========================================= */
/* --- NOVO: ESTILOS DA CAIXA DE CONVITE --- */
/* ========================================= */
.referral-box {
    background-color: #333;
    border: 1px dashed #f0b90b;
    padding: 20px 25px;
    border-radius: 8px;
    border-top: none; /* Já tem a borda do .account-section */
}

.referral-box h3 {
    color: #f0b90b;
    margin-top: 0;
}

.referral-box p {
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
}

.referral-box label {
    display: block;
    font-weight: bold;
    color: #fff;
    font-size: 15px;
    margin-bottom: 8px;
}

.referral-code-wrapper {
    display: flex;
}

.referral-code-wrapper input[type="text"] {
    flex-grow: 1;
    padding: 12px;
    background-color: #1e1e1e;
    border: 1px solid #555;
    border-radius: 8px 0 0 8px;
    color: #fff;
    font-size: 18px;
    font-family: monospace;
    font-weight: bold;
}

.referral-code-wrapper button {
    padding: 10px 15px;
    background-color: #f0b90b;
    color: #1e1e1e;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
}

.referral-code-wrapper button:hover {
    opacity: 0.9;
}

/* ========================================= */
/* --- NOVO: ESTILOS PARA O LOGIN COM +258 --- */
/* ========================================= */
.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 {
    padding-right: 10px;
    font-weight: bold;
    color: #aaa;
    border-right: 1px solid #555;
    margin-right: 10px;
    font-size: 16px;
}
.login-form .phone-input-group input[type="tel"] {
    /* Herda estilos, mas remove borda e fundo próprios */
    padding: 12px 0;
    background: none;
    border: none;
    flex-grow: 1; /* Ocupar espaço restante */
}
.login-form .phone-input-group input[type="tel"]:focus {
    outline: none;
}

/* ========================================= */
/* --- INÍCIO: NOVOS ESTILOS PARA MODAL DE LEVANTAMENTO --- */
/* ========================================= */

.withdrawal-form p {
    color: #ccc; /* Garante que o texto do parágrafo é claro */
}
.withdrawal-form p strong {
    color: #fff; /* Destaque para texto em negrito */
}

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

.withdrawal-form input[type="tel"],
.withdrawal-form input[type="text"],
.withdrawal-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;
}

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

.withdrawal-form small {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.withdrawal-form .button-view-tickets {
    padding: 15px; /* Tornar o botão de submissão maior */
}

/* ========================================= */
/* --- FIM: NOVOS ESTILOS PARA MODAL DE LEVANTAMENTO --- */
/* ========================================= */

/* ========================================= */
/* --- NOVO: ESTILOS PAINEL DO CRIADOR (VERDE) --- */
/* ========================================= */

.creator-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metric-card {
    background-color: #333;
    padding: 20px 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid #444;
}

.metric-card .metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #f0f0f0;
    line-height: 1.2;
}

.metric-card .metric-value.metric-currency {
    color: #2ecc71; /* VERDE de destaque para o criador */
}

.metric-card .metric-label {
    font-size: 13px;
    color: #aaa;
    margin-top: 5px;
}

.metric-card.metric-paid {
    background-color: #274b34; /* Verde escuro */
    border-color: #2ecc71;
}
.metric-card.metric-paid .metric-value {
    color: #2ecc71;
}

.metric-card.metric-failed {
    background-color: #5a2d2d; /* Vermelho escuro */
    border-color: #a00;
}
.metric-card.metric-failed .metric-value {
    color: #e74c3c;
}

/* Estilos de Status na Tabela de Log */
.commission-log-entry td.status-success strong {
    color: #2ecc71;
}
.commission-log-entry td.status-failed strong {
    color: #e74c3c;
}

/* Ajuste Responsivo */
@media screen and (max-width: 600px) {
    .creator-metrics-grid {
        grid-template-columns: 1fr; /* Colunas empilhadas em mobile */
    }
}