/* Estilos Gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', sans-serif;
    position: relative;
    overflow-x: hidden;
    color: #333;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Enquanto não temos a imagem de fundo, usamos um gradiente */
.background-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6e45e2, #88d3ce);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    margin: 0 auto;
    flex: 1;
    margin-top: 120px; /* Aumentado para dar mais espaço ao header */
}

/* Header e navegação */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    z-index: 1000;
    height: auto; /* Altura automática baseada no conteúdo */
}

.logo h1 {
    font-size: 1.5rem;
    color: #6e45e2;
    margin: 0;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #6e45e2;
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-secondary {
    background-color: #FFC107;
    color: #333;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #FFA000;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: #6e45e2;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    border: 1px solid #6e45e2;
    cursor: pointer;
}

.btn-outline:hover {
    background-color: #6e45e2;
    color: white;
    transform: translateY(-2px);
}

.user-info {
    position: relative;
    cursor: pointer;
}

.user-info #user-name {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    background-color: #f0f0f0;
    transition: background-color 0.3s;
}

.user-info:hover #user-name {
    background-color: #e0e0e0;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.user-info:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
}

.user-dropdown a:hover {
    background-color: #f0f0f0;
}

/* Botão de logout fixo */
.logout-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #F44336;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
}

.logout-button:hover {
    background-color: #D32F2F;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

body.is-authenticated .logout-button {
    display: block;
}

/* Páginas */
.page {
    min-height: 70vh;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

.hero-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #6e45e2;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #555;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
    border-radius: 8px;
    padding: 14px 28px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 16px;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Features Section */
.features-section {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 60px;
}

.feature {
    flex: 1;
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature h3 {
    margin-bottom: 15px;
    color: #6e45e2;
}

/* Winners Section */
.winners-section {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 60px;
}

.winners-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #6e45e2;
}

.winners-list {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.winner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.winner-avatar {
    font-size: 2rem;
    background-color: #f0f0f0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-name {
    font-weight: 600;
}

.winner-prize {
    color: #4CAF50;
    font-weight: 700;
}

/* Form Container */
.form-container {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 12px 32px rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 600px;
    margin: 0 auto;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #6e45e2;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #424242;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #6e45e2;
    box-shadow: 0 0 0 3px rgba(110, 69, 226, 0.2);
    outline: none;
}

.form-link {
    text-align: center;
    margin-top: 20px;
}

.form-link a {
    color: #6e45e2;
    text-decoration: none;
    font-weight: 500;
}

.form-link a:hover {
    text-decoration: underline;
}

/* Raspadinhas Grid */
.raspadinhas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

/* Raspadinha */
.raspadinha {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-color: #fff;
    aspect-ratio: 1 / 1;
}

.raspadinha:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.raspadinha-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.raspadinha-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
}

.raspadinha-premio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.premio-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.premio {
    font-weight: 700;
    font-size: 1.2rem;
    color: #4CAF50;
    text-align: center;
}

.raspadinha.raspada .raspadinha-canvas {
    opacity: 0;
    pointer-events: none;
}

/* Status Messages */
.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.status-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4CAF50;
    color: #388E3C;
}

.status-info {
    background-color: rgba(33, 150, 243, 0.1);
    border-left: 4px solid #2196F3;
    color: #1976D2;
}

.status-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #FFC107;
    color: #FFA000;
}

.status-error {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid #F44336;
    color: #D32F2F;
}

/* Animações */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 1.5s infinite;
}

/* Histórico e Saldo */
.user-stats {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #6e45e2;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.historico-container {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.historico-container h3 {
    margin-bottom: 15px;
    color: #6e45e2;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.historico-list {
    max-height: 400px;
    overflow-y: auto;
}

.historico-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.historico-item:last-child {
    border-bottom: none;
}

.historico-data {
    color: #666;
    font-size: 0.9rem;
}

.historico-valor {
    font-weight: 700;
}

.historico-valor.positivo {
    color: #4CAF50;
}

.historico-valor.negativo {
    color: #F44336;
}

.historico-empty {
    text-align: center;
    padding: 20px;
    color: #666;
}

.saldo-card {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-bottom: 30px;
}

.saldo-label {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 10px;
}

.saldo-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 20px;
}

.saldo-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.saldo-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.saldo-info p {
    margin: 0;
}

.saque-info {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Botão WhatsApp */
.whatsapp-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transition: all 0.3s ease;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.whatsapp-icon {
    font-size: 30px;
    color: white;
}

/* Botão Ver Valor Ganho */
#btn-ver-valor-ganho {
    display: none;
    margin: 20px auto;
    padding: 16px 30px;
    font-size: 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#btn-ver-valor-ganho:hover {
    background-color: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Página de Saque */
#page-saque .form-container {
    text-align: center;
}

#resultado-container {
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
}

#valor-ganho {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4CAF50;
    display: block;
    margin: 10px 0;
}

#saque-form {
    margin-top: 30px;
}

/* Responsividade */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        padding: 10px;
    }
    
    .main-nav {
        margin: 10px 0;
    }
    
    .main-nav ul {
        gap: 10px;
    }
    
    .container {
        padding: 15px;
        margin-top: 160px; /* Aumentado para dar mais espaço ao header em mobile */
    }
    
    .hero-section {
        padding: 30px 15px;
    }
    
    .hero-section h2 {
        font-size: 1.8rem;
    }
    
    .features-section {
        flex-direction: column;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .raspadinhas-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .user-stats {
        flex-direction: column;
    }
    
    .saldo-actions {
        flex-direction: column;
    }
    
    .whatsapp-button {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-icon {
        font-size: 25px;
    }
    
    /* Ajuste do botão de logout para mobile */
    .logout-button {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .raspadinhas-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .btn-primary {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .container {
        margin-top: 180px; /* Ainda mais espaço para o header em telas pequenas */
    }
}

/* Visibilidade baseada em autenticação */
.auth-only {
    display: none;
}

.no-auth-only {
    display: block;
}

.admin-only {
    display: none;
}

body.is-authenticated .auth-only {
    display: block;
}

body.is-authenticated .no-auth-only {
    display: none;
}

body.is-admin .admin-only {
    display: block;
}

/* Para elementos inline ou flex */
body.is-authenticated li.auth-only,
body.is-authenticated div.auth-only,
body.is-authenticated span.auth-only,
body.is-authenticated button.auth-only {
    display: inline-block;
}

body.is-admin li.admin-only {
    display: inline-block;
}
