/**
 * Estilos de la Ruleta Animada
 * CDA Previtax
 * 
 * Colores principales:
 * - Dorado: #d4af37
 * - Naranja: #ff8c42
 * - Oscuro: #343a40
 */

/* ============================================
   MODAL DE RULETA
   ============================================ */

.ruleta-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    animation: fadeIn 0.3s ease-in-out;
    backdrop-filter: blur(5px);
}

.ruleta-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ruleta-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    border: 3px solid #d4af37;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ruleta-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: #6c757d;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.ruleta-close:hover {
    background: #f8f9fa;
    color: #dc3545;
    transform: rotate(90deg);
}

.ruleta-title {
    text-align: center;
    color: #343a40;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #d4af37 0%, #ff8c42 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   CONTENEDOR DE RULETA
   ============================================ */

.ruleta-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    aspect-ratio: 1;
}

.ruleta-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 
        0 0 0 6px #d4af37,
        0 0 0 10px rgba(255, 215, 0, 0.6),
        0 0 0 14px #ff8c42,
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 5px 20px rgba(212, 175, 55, 0.3),
        inset 0 0 40px rgba(212, 175, 55, 0.15),
        inset 0 0 20px rgba(255, 140, 66, 0.1);
    transition: transform 0.1s linear;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
}

.ruleta-canvas.spinning {
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Puntero de la ruleta */
.ruleta-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid #d4af37;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ruleta-pointer::after {
    content: '';
    position: absolute;
    top: -35px;
    left: -10px;
    width: 20px;
    height: 20px;
    background: #d4af37;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   BOTÓN DE GIRAR
   ============================================ */

.ruleta-spin-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #d4af37 0%, #ff8c42 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ruleta-spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.ruleta-spin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.ruleta-spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ruleta-spin-btn i {
    font-size: 1.3rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   MODAL DE GANADOR
   ============================================ */

.ruleta-winner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    animation: fadeIn 0.3s ease-in-out;
    backdrop-filter: blur(5px);
}

.ruleta-winner-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ruleta-winner-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: bounceIn 0.5s ease-out;
    border: 3px solid #d4af37;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ruleta-winner-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.ruleta-winner-content h2 {
    color: #343a40;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #d4af37 0%, #ff8c42 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ruleta-winner-content p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.6;
}

.ruleta-winner-subtitle {
    color: #d4af37;
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 10px;
}

.ruleta-register-btn {
    margin-top: 30px;
    padding: 18px 40px;
    background: linear-gradient(135deg, #d4af37 0%, #ff8c42 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.ruleta-register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

/* ============================================
   MODAL DE REGISTRO
   ============================================ */

.ruleta-register-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10002;
    animation: fadeIn 0.3s ease-in-out;
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.ruleta-register-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ruleta-register-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
    border: 3px solid #d4af37;
    margin: 20px 0;
}

.ruleta-register-content h2 {
    text-align: center;
    color: #343a40;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #d4af37 0%, #ff8c42 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Formulario */
.ruleta-form-group {
    margin-bottom: 20px;
}

.ruleta-form-group label {
    display: block;
    color: #343a40;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.ruleta-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.ruleta-form-group input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.ruleta-form-group input::placeholder {
    color: #adb5bd;
}

.ruleta-submit-btn {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #d4af37 0%, #ff8c42 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ruleta-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.ruleta-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ruleta-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.ruleta-message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.ruleta-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .ruleta-modal-content,
    .ruleta-winner-content,
    .ruleta-register-content {
        padding: 30px 20px;
        max-width: 95%;
    }
    
    .ruleta-title {
        font-size: 1.5rem;
    }
    
    .ruleta-winner-content h2 {
        font-size: 2rem;
    }
    
    .ruleta-winner-icon {
        font-size: 4rem;
    }
    
    .ruleta-container {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .ruleta-container {
        max-width: 250px;
    }
    
    .ruleta-title {
        font-size: 1.3rem;
    }
    
    .ruleta-spin-btn,
    .ruleta-register-btn,
    .ruleta-submit-btn {
        font-size: 1rem;
        padding: 15px 20px;
    }
}

