/* ===================================
   CDL Sorte - Estilos Globais
   =================================== */

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

:root {
    /* Cores principais */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* Cores neutras */
    --bg-color: #0f172a;
    --bg-light: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================================
   Cabeçalho
   =================================== */
.header {
    text-align: center;
    padding: 40px 20px;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.header img {
    width: 100%;
    height: auto;
}

/* ===================================
   Roleta
   =================================== */
.roleta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin: 40px 0;
}

.roleta-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#roleta {
    width: 100%;
    height: 100%;
    transition: transform 2s cubic-bezier(0.25, 0.1, 0.25, 1);
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

#roleta.spinning {
    transition: transform 10s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.roleta-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #fbbf24;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

.roleta-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
    border: 4px solid white;
    z-index: 5;
    pointer-events: none;
}

.form-container {
    width: 100%;
    max-width: 600px;
    background: var(--bg-light);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 15px;
    font-size: 1.5rem;
    border: 2px solid transparent;
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

/* ===================================
   Botões
   =================================== */
.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===================================
   Cards
   =================================== */
.card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.card-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.card-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ===================================
   Código do Prêmio
   =================================== */
.codigo-premio {
    background: var(--gradient-primary);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin: 30px 0;
    box-shadow: var(--shadow-glow);
}

.codigo-premio h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.codigo-display {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 5px;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Countdown Timer
   =================================== */
.countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.countdown-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 15px;
    min-width: 100px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.countdown-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.countdown-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===================================
   Tabela de Conferência
   =================================== */
.table-container {
    overflow-x: auto;
    margin-top: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

thead {
    background: var(--gradient-primary);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ===================================
   Alertas e Mensagens
   =================================== */
.alert {
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 2px solid var(--warning-color);
    color: var(--warning-color);
}

/* ===================================
   Animações
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===================================
   Modal
   =================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-light);
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.modal-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.modal-icon.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.modal-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.modal-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.modal-message {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 120px;
    padding: 12px 20px;
    font-size: 1rem;
}

/* ===================================
   Botão Voltar
   =================================== */
.back-button {
    position: fixed; /* Mudado para fixed para ficar sempre visível */
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5); /* Fundo mais escuro para melhor contraste */
    border-radius: 50px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Compatibilidade Safari */
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 9999; /* Garantir que fique acima de tudo */
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap; /* Evita quebra de linha */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-button:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .back-button {
        top: 15px;
        left: 15px;
        font-size: 12px;
        padding: 8px 16px;
    }
}

/* ===================================
   Responsividade
   =================================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .roleta-wrapper {
        width: 350px;
        height: 350px;
    }

    .form-container {
        padding: 25px;
    }

    .codigo-display {
        font-size: 2rem;
        letter-spacing: 3px;
    }

    .countdown-value {
        font-size: 2rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px;
    }

    .back-button {
        top: 10px;
        left: 10px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .roleta-wrapper {
        width: 280px;
        height: 280px;
    }

    .countdown {
        gap: 10px;
    }

    .countdown-item {
        min-width: 70px;
        padding: 15px 10px;
    }
}