/* ──────────────────────────────────────────
   Spin Wheel CSS — Mobile-first
────────────────────────────────────────── */

/* ── Trigger (kenar çubuğu) ─────────────── */
.spin-trigger {
    position: fixed;
    z-index: 9990;
    cursor: pointer;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(55%);
    width: 56px;
    height: 56px;
    border-radius: 50% 0 0 50%;
    box-shadow: -3px 0 18px rgba(0,0,0,0.25);
    transition: transform 0.3s ease;
}

.spin-trigger:hover {
    transform: translateY(-50%) translateX(0);
    animation: none;
}

.spin-trigger-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.spin-trigger-icon svg {
    width: 28px;
    height: 28px;
}

/* ── Modal Overlay ───────────────────────── */
.spin-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 0;
}

.spin-modal.active {
    display: flex;
    opacity: 1;
}

/* ── Modal İçerik (desktop) ──────────────── */
.spin-content {
    background: white;
    width: min(860px, 96vw);
    max-height: 92vh;
    border-radius: 24px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    transform: scale(0.85);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.spin-modal.active .spin-content {
    transform: scale(1);
}

/* ── Kapat Butonu ────────────────────────── */
.spin-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    border: none;
    color: #333;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.spin-close:hover {
    background: #f1f1f1;
    transform: scale(1.1);
}

/* ── Sol (Çark) ──────────────────────────── */
.spin-left {
    flex: 0 0 360px;
    background: linear-gradient(145deg, #f8f9fa 0%, #eef0f2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    position: relative;
    overflow: hidden;
}

.spin-left::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    pointer-events: none;
}

/* ── Çark Sarıcı ─────────────────────────── */
.wheel-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.18));
}

.wheel-canvas {
    width: 100%;
    height: 100%;
    transition: transform 4s cubic-bezier(0.2, 0, 0, 1);
}

.wheel-marker {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    z-index: 5;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 1px;
    color: #1a1a1a;
    border: 4px solid white;
    user-select: none;
}

/* ── Sağ (Form) ──────────────────────────── */
.spin-right {
    flex: 1;
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.spin-title {
    font-size: 32px;
    font-weight: 900;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.spin-desc {
    color: #6b7280;
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.5;
}

.spin-formgroup {
    margin-bottom: 14px;
    text-align: left;
}

.spin-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 15px;
    transition: border-color 0.2s, background 0.2s;
    background: #f9fafb;
    color: #111;
    box-sizing: border-box;
}

.spin-input:focus {
    border-color: #1a1a1a;
    background: #fff;
    outline: none;
}

.spin-btn {
    width: 100%;
    padding: 15px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    margin-top: 8px;
    letter-spacing: 0.5px;
}

.spin-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.spin-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spin-marketing {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    text-align: left;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
}

.spin-marketing input {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Sonuç Ekranı ────────────────────────── */
.spin-result {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.result-icon {
    font-size: 56px;
    margin-bottom: 18px;
    animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.result-title {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 10px;
    color: #111;
    letter-spacing: -0.5px;
}

.result-message {
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.5;
    font-size: 15px;
}

/* ──────────────────────────────────────────
   Mobil Responsive
────────────────────────────────────────── */
@media (max-width: 767px) {
    .spin-modal {
        padding: 0;
        align-items: flex-end; /* Alt sheet stili */
    }

    .spin-content {
        flex-direction: column;
        width: 100%;
        max-height: 96dvh;   /* dynamic viewport height */
        border-radius: 20px 20px 0 0;
        transform: translateY(40px);
        overflow: hidden;
    }

    .spin-modal.active .spin-content {
        transform: translateY(0);
    }

    .spin-left {
        flex: 0 0 auto;
        padding: 28px 20px 16px;
        background: linear-gradient(160deg, #f0f2f5 0%, #e6e9ed 100%);
    }

    .wheel-wrapper {
        width: min(240px, 64vw);
        height: min(240px, 64vw);
    }

    .wheel-center {
        width: 52px;
        height: 52px;
        font-size: 11px;
    }

    .spin-right {
        flex: 1;
        padding: 20px 22px 28px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .spin-title {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .spin-desc {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .spin-btn {
        padding: 14px;
        font-size: 15px;
    }

    .spin-close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }
}

/* Çok küçük ekranlar (iPhone SE vb.) */
@media (max-width: 374px) {
    .spin-left {
        padding: 20px 16px 12px;
    }

    .wheel-wrapper {
        width: min(210px, 60vw);
        height: min(210px, 60vw);
    }

    .spin-right {
        padding: 16px 18px 24px;
    }

    .spin-title {
        font-size: 21px;
    }
}

/* ── Animasyonlar ────────────────────────── */

@keyframes pop-in {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
