* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Moderno */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a {
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav a:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav a:hover::after {
    width: 80%;
}

.nav span {
    color: var(--gray);
    font-weight: 500;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Cards de Rifa Modernos */
.rifas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.rifa-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rifa-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.rifa-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rifa-card:hover img {
    transform: scale(1.05);
}

.sem-imagem {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.rifa-info {
    padding: 1.5rem;
}

.rifa-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.rifa-info > p {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Progress Bar Moderna */
.progresso-container {
    margin: 1rem 0;
}

.progresso-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.progresso {
    background: var(--gray-light);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.barra {
    background: linear-gradient(90deg, var(--success), #34d399);
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s ease;
    position: relative;
}

.barra::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.valor {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
    text-align: center;
}

/* Botões Modernos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #fbbf24);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Filtros Modernos */
.filtros {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.filtros .btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.filtros .btn:hover {
    background: white;
    color: var(--primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Formulários Modernos */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark);
    font-weight: 700;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

/* Alertas Modernos */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    font-weight: 500;
}

.alert.sucesso {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-color: #a7f3d0;
}

.alert.erro {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #fecaca;
}

.alert.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Footer Moderno */
.footer {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Admin Header */
.admin-header {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.admin-header nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-header nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.admin-header nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Grid de Usuários */
.usuarios-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.usuario-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    border: 1px solid var(--gray-light);
}

.usuario-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.form-section {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid var(--gray-light);
}

/* Modal Moderno */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger);
}

/* Números da Rifa */
.numeros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    margin-top: 2rem;
}

.numero {
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 0.8rem;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.numero:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.numero.pago {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
    border-color: var(--success);
}

.numero.reservado {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: white;
    border-color: var(--warning);
}

/* Responsivo */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 0.5rem;
    }
    
    .rifas-grid {
        grid-template-columns: 1fr;
    }
    
    .usuarios-grid {
        grid-template-columns: 1fr;
    }
    
    .filtros {
        justify-content: center;
    }
    
    .admin-header nav {
        flex-direction: column;
        align-items: center;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Animações extras */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.rifa-card {
    animation: fadeIn 0.6s ease;
}

/* Loading states */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos específicos para o modal de compra */
.modal-content {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.numeros-selecao {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
}

.numero-disponivel {
    padding: 0.8rem;
    border: 2px solid var(--primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    text-align: center;
    font-weight: 600;
}

.numero-disponivel:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.numero-disponivel.selecionado {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: var(--primary-dark);
    transform: scale(1.1);
}

/* Scrollbar personalizada */
#numerosContainer::-webkit-scrollbar {
    width: 8px;
}

#numerosContainer::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

#numerosContainer::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

#numerosContainer::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsividade do modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 5% 10px;
        width: calc(100% - 20px);
    }
    
    .modal-content > div {
        grid-template-columns: 1fr !important;
    }
    
    #numerosContainer {
        max-height: 300px;
    }
}

/* Fallback para imagens quebradas */
img {
    object-fit: contain;
}
/* Estilos para as abas */
.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--primary);
    background: #f8f9fa;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Status das rifas */
.status-ativo {
    background: var(--success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-finalizado {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pendente {
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tabelas responsivas */
.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Botões pequenos */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    text-align: center;
}

/* Cores dos botões */
.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger:hover {
    background: #c82333;
}
/* Animações para o sorteio */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Estilos para números */
.numero-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.numero-item.ganhador {
    background: #28a745;
    color: white;
    border-color: #1e7e34;
    transform: scale(1.1);
}

/* Cards de estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.5rem 0;
}