/* ===========================
   Sistema de Apostas Mobile - App-Like Enhanced
   =========================== */

/* Variáveis de Cores e Configurações Globais */
:root {
    --primary-color: #ff7b00;
    --primary-gradient: linear-gradient(135deg, #FF9500, #FF6F00);
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --white: #ffffff;
    --dark-green: #2e7d32;
    --red: #f44336;
    --blue: #007bff;
    --border-color: #e0e0e0;
}

/* Reset e base */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--secondary-color);
    margin: 0;
    padding: 0 0 60px 0;
    color: var(--text-color);
    overscroll-behavior: none;
}

/* Container principal */
.mpa-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

/* Card principal */
.mpa-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.mpa-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff7b00, #ffd900);
}

/* Títulos */
.mpa-card h2 {
    font-size: 22px;
    text-align: center;
    color: var(--text-color);
    margin: 0 0 24px 0;
    font-weight: 700;
    position: relative;
}

.mpa-card h2:after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #ff7b00, #ffd900);
    margin: 8px auto 0;
    border-radius: 2px;
}

/* Grid e Inputs */
.mpa-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 0 auto 20px auto;
    width: 100%;
}

.mpa-input {
    width: 100%;
    height: 60px;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    background: #fafafa;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mpa-input:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.2);
    transform: scale(1.05);
}

.mpa-input.input-error {
    border-color: var(--red);
    background: #fff5f5;
    animation: shake 0.5s ease-in-out;
}

.mpa-telefone-input {
    width: 100%;
    max-width: 280px;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #fafafa;
    transition: all 0.2s ease;
}

.mpa-telefone-input:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.2);
}

.mpa-row-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* NOVO: Estilos para os botões compactos em linha */
.mpa-actions-compact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    width: 100%;
}

.mpa-btn-plus {
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 20px !important;
    min-width: auto !important;
}

/* =============================================
   Botões Base
   ============================================= */
.mpa-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--white) !important;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    gap: 8px;
    transform: translateY(0);
    letter-spacing: 0.5px;
}

.mpa-btn:after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.mpa-btn:hover:after {
    left: 100%;
}

.mpa-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.mpa-btn:active {
    transform: translateY(1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Variações de Botão */
.mpa-btn-carrinho {
    background: var(--primary-gradient);
    box-shadow: 0 6px 15px rgba(255, 149, 0, 0.3);
}

.mpa-btn-carrinho:hover {
    background: linear-gradient(135deg, #FF6F00, #E05F00);
    box-shadow: 0 10px 25px rgba(255, 149, 0, 0.4);
}

.mpa-btn-finalizar {
    background: linear-gradient(135deg, #FFB300, #FF8F00);
    box-shadow: 0 6px 15px rgba(255, 179, 0, 0.3);
}

.mpa-btn-finalizar:hover {
    background: linear-gradient(135deg, #FF8F00, #E07F00);
    box-shadow: 0 10px 25px rgba(255, 179, 0, 0.4);
}

/* Botões de Download PDF */
.mpa-download-all-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.mpa-btn-pdf {
    background: var(--blue);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.mpa-btn-pdf:hover {
    background: #0056b3;
}

/* Botão desabilitado */
.mpa-btn.mpa-btn-disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Resumo do Carrinho */
.mpa-cart-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.mpa-cart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mpa-cart-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.mpa-cart-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Nota */
.mpa-note {
    font-size: 13px;
    color: #757575;
    margin-top: 16px;
    text-align: center;
    line-height: 1.4;
}

/* Badges das dezenas */
.mpa-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin: 4px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(255, 123, 0, 0.3);
}

/* Listas de Jogos */
.mpa-jogos-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mpa-jogo-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mpa-jogo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.mpa-jogo-data {
    font-size: 12px;
    color: #6c757d;
}

.mpa-dezenas-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.mpa-dezenas-linha {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.mpa-badge-compact {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: var(--primary-gradient);
    color: var(--white);
    border-radius: 8px;
    width: 100%;
    height: 36px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(255, 123, 0, 0.2);
    flex: 1;
    min-width: 0;
}

/* Status badges */
.mpa-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.mpa-status-pendente {
    background: #fff3cd;
    color: #856404;
}

.mpa-status-pago {
    background: #d4edda;
    color: #155724;
}

.mpa-status-cancelado {
    background: #f8d7da;
    color: #721c24;
}

/* Relatórios e Painel Admin */
.mpa-relatorio {
    background: #fff8e1;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    font-size: 16px;
    line-height: 1.5;
}

.mpa-admin-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.mpa-admin-panel p {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.mpa-admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.mpa-admin-table th,
.mpa-admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.mpa-admin-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.mpa-admin-table tr:hover {
    background: #f9f9f9;
}

/* Mensagem de Apostas Fechadas */
.mpa-apostas-fechadas-message {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border-radius: 12px;
    margin: 20px 0;
    color: #856404;
}

/* ===========================
   Menu Inferior
   =========================== */
.mpa-bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mpa-bottom-menu .mpa-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mpa-bottom-menu .mpa-menu-item i {
    font-size: 20px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.mpa-bottom-menu .mpa-menu-item:hover,
.mpa-bottom-menu .mpa-menu-item.active {
    color: var(--text-color);
}

.mpa-bottom-menu .mpa-menu-item:active i,
.mpa-bottom-menu .mpa-menu-item.active i {
    animation: mpa-icon-pulse 0.3s ease-in-out;
}

.mpa-bottom-menu .mpa-menu-item span {
    font-size: 10px;
    line-height: 1;
}

/* ===========================
   Responsividade
   =========================== */
@media (max-width: 480px) {
    .mpa-container { padding: 12px; }
    .mpa-card { padding: 20px 16px; border-radius: 14px; }
    .mpa-grid { gap: 8px; }
    .mpa-input { height: 50px; font-size: 16px; padding: 10px; border-radius: 10px; }
    .mpa-btn { width: 100%; padding: 14px; font-size: 15px; min-width: auto; }
    .mpa-telefone-input { font-size: 16px; padding: 12px; }
    .mpa-cart-summary { gap: 20px; padding: 12px; }
    .mpa-cart-label { font-size: 13px; }
    .mpa-cart-value { font-size: 16px; }
    .mpa-actions .mpa-btn { max-width: none; }
    .mpa-bottom-menu { height: 55px; }
    .mpa-bottom-menu .mpa-menu-item i { font-size: 18px; }
    .mpa-bottom-menu .mpa-menu-item span { font-size: 9px; }
    .mpa-admin-table { font-size: 14px; }
    .mpa-admin-table th, 
    .mpa-admin-table td { padding: 8px; }
    
    .mpa-badge-compact {
        height: 32px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .mpa-jogo-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .mpa-jogo-data {
        font-size: 11px;
    }

    /* Ajustes responsivos para botões compactos */
    .mpa-actions-compact {
        gap: 8px;
    }
    
    .mpa-btn-plus {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
    }
}

@media (max-width: 360px) {
    .mpa-badge-compact {
        height: 30px;
        font-size: 12px;
    }
    
    .mpa-dezenas-linha {
        gap: 3px;
    }

    .mpa-btn-plus {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
}

/* Zoom fix iOS */
@media screen and (max-width: 767px) {
    input, select, textarea { font-size: 16px !important; }
}

/* ==========================
   Animações
   ========================== */
@keyframes shake {
  0% { transform: translateX(0px); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes mpa-icon-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes mpa-slideIn {
    from { transform: translate(-50%, -100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes mpa-slideOut {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, -100px); opacity: 0; }
}

/* ==========================
   Utilitários de Pop-up
   ========================== */
.mpa-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-green);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    opacity: 0;
}

.mpa-popup-error {
    background-color: var(--red);
}

.mpa-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}


/* --- Correção para os botões do Painel de Administração --- */
#mpa-frontend-toggle,
#mpa-frontend-export,
#mpa-frontend-clear {
    color: #000000 !important; /* Define a cor do texto para preto */
    font-size: 14px !important; /* Garante que a fonte tenha um tamanho visível */
    text-indent: 0 !important; /* Zera qualquer recuo de texto que possa estar escondendo o conteúdo */
}

/* Opcional: Garante que os ícones fiquem alinhados se houverem */
#mpa-frontend-toggle .fa,
#mpa-frontend-export .fa,
#mpa-frontend-clear .fa {
    margin-right: 5px;
}

/* Espaçamento para os botões do Painel de Administração */
.mpa-admin-panel button {
    margin-bottom: 10px; /* Adiciona 10px de espaço abaixo de cada botão */
}

/* Para remover o espaço extra do último botão, se não for necessário */
.mpa-admin-panel button:last-child {
    margin-bottom: 0;
}

/* --- CORREÇÃO para os campos de dezenas cortados --- */
.mpa-input {
    font-size: 20px !important; /* Aumenta a fonte para caber no campo */
    padding: 10px !important; /* Reduz o espaço interno */
    height: 50px !important; /* Ajusta a altura para telas pequenas */
    box-sizing: border-box !important; /* Garante que o padding não cause corte */
    text-align: center !important; /* Centraliza o texto para melhor visualização */
}

/* Garante que o ajuste funcione em telas pequenas */
@media (max-width: 480px) {
    .mpa-input {
        font-size: 20px !important;
        padding: 8px !important;
    }
}







/* FALLBACK PARA ÍCONES SE FONT AWESOME NÃO CARREGAR */
.mpa-btn-plus:before {
    content: "+";
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 24px;
}

.mpa-btn-plus i {
    display: none;
}

/* Fallback para outros ícones */
.mpa-btn-finalizar i:before {
    content: "✓";
    font-family: Arial, sans-serif;
    font-weight: bold;
}

.mpa-btn-finalizar i {
    display: none;
}