/* Estilos para o Módulo da Roleta Gamificada */
.wheel-modal {
    display: none; /* Inicia oculto, será mostrado via JavaScript */
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.wheel-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    max-width: 800px;
    position: relative;
}

/* Botão fechar */
.wheel-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.wheel-close:hover,
.wheel-close:focus {
    color: black;
    text-decoration: none;
}

/* Cabeçalho */
.wheel-header {
    text-align: center;
    margin-bottom: 20px;
}

.wheel-header h2 {
    margin-top: 0;
    color: #333;
}

/* Container da roleta */
.wheel-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

/* Canvas da roleta */
.wheel-canvas-container {
    position: relative;
    width: 380px;
    height: 380px;
    margin: 0 auto;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Estilo para o ponteiro */
.wheel-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    z-index: 5;
    pointer-events: none;
}

.wheel-pointer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #ff0000;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

.wheel-pointer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background-color: #ff0000;
    border-radius: 50%;
    border: 2px solid black;
    z-index: 10;
}

#wheel-canvas {
    display: block;
    margin: 0 auto;
}

/* Formulário */
.wheel-form-container {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 20px;
}

.wheel-form-group {
    margin-bottom: 15px;
}

.wheel-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.wheel-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.wheel-form-group input.error {
    border-color: #ff0000;
}

.wheel-form-group input.error-permanent {
    border-color: #ff0000;
    background-color: #ffeeee;
}

.wheel-error {
    color: #ff0000;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

/* Botões */
.wheel-btn {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.wheel-btn:hover {
    background-color: #45a049;
}

.wheel-btn.disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.wheel-btn-secondary {
    background-color: #f1f1f1;
    color: #333;
}

.wheel-btn-secondary:hover {
    background-color: #e1e1e1;
}

/* Resultado */
.wheel-result {
    text-align: center;
    padding: 20px;
}

.wheel-prize-text {
    font-size: 20px;
    margin-bottom: 10px;
}

.wheel-coupon-text {
    font-size: 18px;
    margin-bottom: 20px;
}

.wheel-tip {
    color: #666;
    margin-bottom: 15px;
}

/* Responsividade */
@media (max-width: 768px) {
    .wheel-container {
        flex-direction: column;
    }
    
    .wheel-canvas-container {
        width: 100%;
        max-width: 320px;
        height: 320px;
        margin: 0 auto 20px auto;
    }
    
    .wheel-form-container {
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }
    
    .wheel-modal-content {
        margin: 2% auto;
        padding: 15px;
        width: 95%;
        max-width: 95%;
    }
    
    #wheel-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .wheel-static-pointer {
        border-width: 15px 8px 0 8px !important;
    }
}

@media (max-width: 480px) {
    .wheel-canvas-container {
        width: 100%;
        max-width: 280px;
        height: 280px;
        margin: 0 auto 15px auto;
    }
    
    .wheel-modal-content {
        margin: 1% auto;
        padding: 10px;
        width: 98%;
        max-width: 98%;
    }
    
    .wheel-header h2 {
        font-size: 1.5em;
    }
    
    .wheel-form-container {
        padding: 5px;
    }
}

@media (max-width: 360px) {
    .wheel-canvas-container {
        width: 100%;
        max-width: 250px;
        height: 250px;
        margin: 0 auto 10px auto;
    }
    
    .wheel-header h2 {
        font-size: 1.3em;
    }
    
    .wheel-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .wheel-static-pointer {
        border-width: 12px 6px 0 6px !important;
    }
}

/* Elementos de debug visual - melhorados */
.wheel-debug-color {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: 2px solid black;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.wheel-debug-info {
    position: absolute;
    top: 50px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    padding: 8px;
    border-radius: 5px;
    font-size: 12px;
    max-width: 180px;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    border: 1px solid #ddd;
}

.wheel-debug-info strong {
    color: #333;
}

/* Animações */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

/* Classe para animação da roleta */
.wheel-spinning {
    animation: spin 4s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
}

.wheel-btn.disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.wheel-btn.disabled:hover {
    background-color: #ccc;
}

.wheel-form-group input.error-permanent:disabled {
    background-color: #fff5f5;
    cursor: not-allowed;
    opacity: 0.8;
}

.wheel-form-group input.error-permanent + .wheel-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: block;
    font-weight: bold;
}