/**
 * Estilos da Ação Entre Amigos
 * Sistema de design responsivo e moderno
 * Versão: 2.0
 */

/* Reset e configurações base */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.erro {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    padding: 18px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
    box-shadow: 0 4px 15px rgba(114, 28, 36, 0.1);
    font-weight: 500;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Cabeçalho */
h1 {
    color: #ffffff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.dica {
    background: rgba(255,255,255,0.9);
    color: #2c3e50;
    padding: 12px 20px;
    border-radius: 25px;
    margin-bottom: 30px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Container principal */
#acao-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 12px;
    max-width: 900px;
    width: 100%;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

/* Números da rifa */
.numero {
    padding: 15px 8px;
    text-align: center;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.3em;
    cursor: default;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.numero::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.numero:hover::before {
    left: 100%;
}

.numero:hover {
    transform: scale(1.05);
}

/* Estados dos números */
.disponivel {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.disponivel:hover {
    background: linear-gradient(135deg, #1e7e34, #17a085);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    transform: scale(1.1);
}

.selecionado {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    color: white;
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
    z-index: 2;
}

.vendido {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    text-decoration: line-through;
    opacity: 0.7;
    cursor: not-allowed;
}

/* Animações */
.numero-animacao {
    animation: selecionarNumero 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes selecionarNumero {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1.08); }
}

.shake {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px) rotate(-2deg); }
    40% { transform: translateX(8px) rotate(2deg); }
    60% { transform: translateX(-8px) rotate(-2deg); }
    80% { transform: translateX(8px) rotate(2deg); }
}

/* Loading */
#loading {
    font-size: 1.3em;
    color: #2c3e50;
    padding: 30px;
    text-align: center;
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Resumo */
#summary {
    margin-top: 25px;
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    background: rgba(255,255,255,0.9);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Carrinho flutuante */
#carrinho {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 18px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    z-index: 999;
    backdrop-filter: blur(10px);
}

#carrinho:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

#carrinho.show {
    display: block;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.carrinho-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.carrinho-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    animation: slideInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #212529;
}

.modal-content * {
    color: #212529 !important;
    font-weight: 600 !important;
}

.modal-content h2 {
    color: #212529 !important;
    margin-bottom: 20px;
    font-weight: 700 !important;
}

.modal-content p,
.modal-content label,
.modal-content span,
.modal-content div {
    color: #212529 !important;
    font-weight: 600 !important;
}

.info-compra,
.info-compra *,
.info-compra p,
.info-compra span {
    color: #212529 !important;
    font-weight: 600 !important;
}

#numeros-selecionados-resumo,
#valor-por-numero,
#valor-total-resumo {
    color: #212529 !important;
    font-weight: 700 !important;
}

small,
.small,
#reserva-info {
    color: #212529 !important;
    font-weight: 600 !important;
}

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

.close {
    color: #495057;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
    position: absolute;
    top: 15px;
    right: 20px;
}

.close:hover,
.close:focus {
    color: #e74c3c;
    transform: scale(1.1);
}

/* Etapas do modal */
.etapa {
    display: none;
}

.numero-destaque {
    font-size: 3.5em;
    color: #28a745;
    font-weight: bold;
    margin: 25px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Botões */
.btn-contribuir,
.btn-reservar {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    margin: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-contribuir:hover,
.btn-reservar:hover {
    background: linear-gradient(135deg, #1e7e34, #17a085);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.btn-reservar {
    background: linear-gradient(135deg, #007bff, #0056b3);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-reservar:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.loading-btn {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Seções informativas */
.info-compra,
.form-reserva {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 15px;
    margin: 25px 0;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.info-compra h3 {
    margin-top: 0;
    color: #212529 !important;
    font-size: 1.3em;
    font-weight: 700 !important;
}

/* Formulário */
.form-reserva input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
    color: #212529;
    font-weight: 600;
}

.form-reserva input::placeholder {
    color: #495057;
    opacity: 1;
}

.form-reserva input:focus {
    border-color: #28a745;
    outline: none;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

.form-reserva input:invalid {
    border-color: #e74c3c;
}

/* Mensagens de status */
.sucesso {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    padding: 18px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
    box-shadow: 0 4px 15px rgba(21, 87, 36, 0.1);
    font-weight: 500;
}

.erro {
    background: linear-gradient(135deg, #f8d7da, #f1aeb5);
    color: #721c24;
    padding: 18px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid #f1aeb5;
    box-shadow: 0 4px 15px rgba(114, 28, 36, 0.1);
}

.info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    padding: 18px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid #bee5eb;
    box-shadow: 0 4px 15px rgba(12, 84, 96, 0.1);
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    #acao-container {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 8px;
        padding: 20px;
    }
    
    .numero {
        padding: 12px 6px;
        font-size: 1.1em;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 25px;
        width: 95%;
    }
    
    #carrinho {
        bottom: 20px;
        right: 20px;
        padding: 15px 20px;
    }
    
    .btn-contribuir,
    .btn-reservar {
        padding: 14px 28px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    #acao-container {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 6px;
        padding: 15px;
    }
    
    .numero {
        padding: 10px 4px;
        font-size: 1em;
    }
    
    .numero-destaque {
        font-size: 2.5em;
    }
}

/* Modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #2c3e50;
        color: white;
    }
    
    .modal-content h2 {
        color: #ecf0f1;
    }
    
    .modal-content p,
    .modal-content label {
        color: #bdc3c7;
    }
    
    .form-reserva input {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7a;
    }
    
    .form-reserva input::placeholder {
        color: #95a5a6;
        opacity: 1;
    }
    
    .form-reserva input:focus {
        border-color: #28a745;
    }
    
    .close {
        color: #bdc3c7;
    }
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* =================
   MODAL PIX
   ================= */

.modal-pix {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
    color: #212529;
}

.modal-pix h2 {
    color: #212529;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.codigo-pix-container {
    position: relative;
    margin: 15px 0;
}

.codigo-pix-container textarea {
    font-family: 'Courier New', Monaco, monospace !important;
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.4;
    border: 2px solid #e74c3c;
    background: #fdf2f2 !important;
    color: #212529;
    font-weight: 600;
}

.codigo-pix-container textarea:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.info-pagamento {
    background: linear-gradient(135deg, #e3f2fd, #f0f7ff) !important;
    border-left: 4px solid #2196f3;
}

.info-pagamento h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1565c0 !important;
}

.info-pagamento ol {
    color: #212529;
    line-height: 1.6;
    font-weight: 500;
}

.info-pagamento ol li {
    margin-bottom: 5px;
}

/* Animação para o modal PIX */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsividade do modal PIX */
@media (max-width: 600px) {
    .modal-pix {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }
    
    .modal-pix h2 {
        font-size: 1.3rem;
    }
    
    .codigo-pix-container textarea {
        font-size: 11px;
        min-height: 100px;
    }
    
    .info-pagamento {
        font-size: 13px;
    }
}
