/* ============================================
   SPINWHEEL - HEDIYE ÇARKI
   Premium Prize Wheel Styles
   ============================================ */

:root {
    --spinwheel-primary: #7c3aed;
    --spinwheel-secondary: #00d4ff;
    --spinwheel-bg: #0a0a1a;
    --spinwheel-card: rgba(15, 20, 40, 0.95);
    --spinwheel-text: #ffffff;
    --spinwheel-muted: rgba(255, 255, 255, 0.6);
    --spinwheel-border: rgba(255, 255, 255, 0.1);
}

/* ============================================
   FLOATING BUTTON
   ============================================ */

.spinwheel-floating-btn {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--spinwheel-primary), var(--spinwheel-secondary));
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: float-btn 3s ease-in-out infinite;
}

@keyframes float-btn {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.spinwheel-floating-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(124, 58, 237, 0.5);
}

.spinwheel-floating-btn i {
    font-size: 1.3rem;
    animation: shake 2s ease-in-out infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: rotate(-5deg);
    }

    20%,
    40%,
    60%,
    80% {
        transform: rotate(5deg);
    }
}

.spinwheel-btn-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.spinwheel-btn-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--spinwheel-primary), var(--spinwheel-secondary));
    opacity: 0;
    animation: pulse-ring 2s infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0;
        transform: scale(1.3);
    }

    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* ============================================
   MODAL OVERLAY
   ============================================ */

.spinwheel-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 15, 0.9);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.spinwheel-modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.spinwheel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    animation: modal-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   WHEEL WRAPPER
   ============================================ */

.spinwheel-wrapper {
    text-align: center;
}

.spinwheel-header {
    margin-bottom: 24px;
}

.spinwheel-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--spinwheel-text);
    margin-bottom: 8px;
}

.spinwheel-subtitle {
    font-size: 1rem;
    color: var(--spinwheel-muted);
}

/* ============================================
   THE WHEEL
   ============================================ */

.spinwheel-wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto 30px;
}

.spinwheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 50px;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.spinwheel-pointer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--spinwheel-primary);
}

.spinwheel-pointer::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid var(--spinwheel-secondary);
}

.spinwheel-wheel {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.1),
        0 0 0 12px var(--spinwheel-primary),
        0 0 60px rgba(124, 58, 237, 0.3);
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.spinwheel-wheel.spinning {
    /* Animation is controlled by JS */
}

.spinwheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    left: 50%;
    top: 0;
    transform-origin: 0% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    padding-left: 10%;
    text-align: center;
    overflow: hidden;
}

.spinwheel-segment-content {
    transform: rotate(22.5deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.spinwheel-segment-icon {
    font-size: 1.5rem;
}

.spinwheel-segment-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    max-width: 70px;
    line-height: 1.2;
}

/* Center circle */
.spinwheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--spinwheel-primary), var(--spinwheel-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
    z-index: 5;
}

.spinwheel-center-text {
    font-size: 2rem;
}

/* ============================================
   SPIN BUTTON
   ============================================ */

.spinwheel-spin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 48px;
    background: linear-gradient(135deg, var(--spinwheel-primary), var(--spinwheel-secondary));
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spinwheel-spin-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(124, 58, 237, 0.5);
}

.spinwheel-spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spinwheel-spin-btn i {
    font-size: 1.3rem;
}

/* ============================================
   PERIOD SELECTOR
   ============================================ */

.spinwheel-period-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.spinwheel-period-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--spinwheel-border);
    border-radius: 8px;
    color: var(--spinwheel-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.spinwheel-period-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.spinwheel-period-btn.active {
    background: var(--spinwheel-primary);
    border-color: var(--spinwheel-primary);
    color: #fff;
}

/* ============================================
   REMAINING SPINS
   ============================================ */

.spinwheel-remaining {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    color: var(--spinwheel-muted);
    font-size: 0.9rem;
}

.spinwheel-remaining i {
    color: var(--spinwheel-secondary);
}

.spinwheel-remaining strong {
    color: var(--spinwheel-text);
}

/* ============================================
   RESULT MODAL
   ============================================ */

.spinwheel-result {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.spinwheel-result.active {
    display: block;
    animation: result-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes result-enter {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.spinwheel-result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.spinwheel-result-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--spinwheel-text);
    margin-bottom: 12px;
}

.spinwheel-result-prize {
    font-size: 1.3rem;
    color: var(--spinwheel-secondary);
    margin-bottom: 16px;
}

.spinwheel-result-code {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(0, 212, 255, 0.1);
    border: 2px dashed var(--spinwheel-secondary);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--spinwheel-secondary);
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.spinwheel-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.spinwheel-result-btn {
    padding: 12px 24px;
    background: var(--spinwheel-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.spinwheel-result-btn:hover {
    background: var(--spinwheel-secondary);
}

.spinwheel-result-btn.secondary {
    background: transparent;
    border: 1px solid var(--spinwheel-border);
    color: var(--spinwheel-muted);
}

/* ============================================
   CLOSE BUTTON
   ============================================ */

.spinwheel-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--spinwheel-border);
    border-radius: 50%;
    color: var(--spinwheel-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.spinwheel-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--spinwheel-text);
}

/* ============================================
   CONFETTI
   ============================================ */

.spinwheel-confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .spinwheel-wheel-container {
        width: 280px;
        height: 280px;
    }

    .spinwheel-center {
        width: 60px;
        height: 60px;
    }

    .spinwheel-center-text {
        font-size: 1.5rem;
    }

    .spinwheel-title {
        font-size: 1.5rem;
    }

    .spinwheel-floating-btn {
        padding: 12px 16px;
    }

    .spinwheel-btn-text {
        display: none;
    }

    .spinwheel-period-selector {
        flex-wrap: wrap;
    }
}