/* =============================================
   Ruleta de Descuentos – YoLoPido
   ============================================= */

/* Hero */
.ruleta-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 60px 0 40px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ruleta-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255, 107, 53, 0.08) 0%, transparent 50%);
    animation: heroPulse 8s ease-in-out infinite alternate;
}

@keyframes heroPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.05) rotate(3deg); }
}

.ruleta-hero .container {
    position: relative;
    z-index: 1;
}

.ruleta-hero h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ruleta-hero .lead {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.15rem;
}

/* Identification Section */
.identify-section {
    margin-top: -30px;
    position: relative;
    z-index: 2;
}

.identify-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px 35px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    max-width: 500px;
    margin: 0 auto;
}

.identify-card .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 600;
    transition: border-color 0.3s;
}

.identify-card .form-control:focus {
    border-color: var(--yolo-cyan);
    box-shadow: 0 0 0 0.2rem rgba(0, 143, 185, 0.15);
}

.btn-identify {
    background: linear-gradient(135deg, var(--yolo-cyan), #0f3460);
    border: none;
    color: #fff;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    width: 100%;
}

.btn-identify:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 143, 185, 0.35);
    color: #fff;
}

/* Spin Balance Badge */
.spin-balance-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b35, #ff9a56);
    color: #fff;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

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

/* =============================================
   THE WHEEL
   ============================================= */
.wheel-section {
    padding: 40px 0;
}

.wheel-container {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0 auto;
}

/* Pointer / Arrow */
.wheel-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 2.5rem;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
    line-height: 1;
}

/* The wheel itself */
.wheel-svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 8px #1a1a2e, 0 0 0 12px var(--yolo-cyan), 0 0 40px rgba(0, 212, 255, 0.2);
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-svg.spinning {
    /* rotation set via JS */
}

/* Center hub */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    border-radius: 50%;
    border: 4px solid var(--yolo-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.wheel-center span {
    font-size: 1.4rem;
}

/* Spin Button */
.btn-spin {
    background: linear-gradient(135deg, #ff6b35, #ff4500);
    border: none;
    color: #fff;
    padding: 18px 60px;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    border-radius: 60px;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s;
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-spin:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 35px rgba(255, 107, 53, 0.5);
    color: #fff;
}

.btn-spin:disabled {
    background: #6c757d;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-spin::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.15) 50%, transparent 60%);
    transition: all 0.5s;
}

.btn-spin:hover:not(:disabled)::after {
    left: 100%;
}

/* =============================================
   RESULT MODAL
   ============================================= */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.result-overlay.show {
    opacity: 1;
    visibility: visible;
}

.result-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-overlay.show .result-card {
    transform: scale(1);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.result-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--yolo-navy);
    margin-bottom: 10px;
}

.result-prize {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 20px;
}

.coupon-display {
    background: linear-gradient(135deg, #f0f9ff, #e8f5e9);
    border: 2px dashed var(--yolo-cyan);
    border-radius: 12px;
    padding: 16px 24px;
    margin: 16px 0;
}

.coupon-code {
    font-family: 'Source Code Pro', monospace;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--yolo-navy);
    letter-spacing: 3px;
}

.coupon-expiry {
    font-size: 0.85rem;
    color: #888;
    margin-top: 6px;
}

.btn-close-result {
    background: var(--yolo-navy);
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 16px;
    transition: all 0.3s;
}

.btn-close-result:hover {
    background: var(--yolo-cyan);
    color: #fff;
}

/* =============================================
   CONFETTI
   ============================================= */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 1;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    80% { opacity: 1; }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* =============================================
   COUPONS SECTION
   ============================================= */
.coupons-section {
    padding: 40px 0;
}

.coupon-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid var(--yolo-cyan);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.coupon-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.coupon-card .coupon-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.coupon-card .coupon-name {
    font-weight: 700;
    color: var(--yolo-navy);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.coupon-card .coupon-code-small {
    font-family: monospace;
    background: #f0f4f8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--yolo-cyan);
    display: inline-block;
    margin: 8px 0;
    letter-spacing: 1px;
}

.coupon-card .coupon-expires {
    font-size: 0.82rem;
    color: #888;
}

.coupon-card .coupon-expires.expiring-soon {
    color: #dc3545;
    font-weight: 600;
}

/* =============================================
   HISTORY SECTION
   ============================================= */
.history-section {
    padding: 20px 0 60px;
}

.history-table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.history-table thead th {
    background: var(--yolo-navy);
    color: #fff;
    font-weight: 600;
    padding: 14px 16px;
    border: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: #f0f0f0;
}

.history-table tbody tr:hover {
    background: #f8fbff;
}

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

    .ruleta-hero .lead {
        font-size: 1rem;
    }

    .identify-card {
        padding: 24px 20px;
    }

    .wheel-container {
        width: 290px;
        height: 290px;
    }

    .btn-spin {
        padding: 16px 50px;
        font-size: 1.3rem;
    }

    .result-card {
        padding: 30px 24px;
    }

    .coupon-code {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }

    .history-table {
        font-size: 0.85rem;
    }

    .history-table thead th,
    .history-table tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 375px) {
    .wheel-container {
        width: 260px;
        height: 260px;
    }

    .ruleta-hero h1 {
        font-size: 1.7rem;
    }

    .btn-spin {
        padding: 14px 40px;
        font-size: 1.1rem;
    }
}
