/* Modern Şans Çarkı Stilleri - Widget Tarzı */
.wheel-container {
    position: fixed;
    z-index: 50;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wheel-container.right {
    right: 20px;
    bottom: 20px;
}

/* Mobile positioning adjustments */
@media (max-width: 768px) {
    .wheel-container.right {
        right: 20px;
        bottom: 100px; /* Above mobile menu and other buttons */
    }
    
    
    .wheel-badge {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: -6px;
        right: -6px;
    }
}

/* Desktop positioning to avoid overlap with scroll to top */
@media (min-width: 769px) {
    .wheel-container.right {
        right: 20px;
        bottom: 20px;
    }
}

.wheel-container.left {
    left: 20px;
    bottom: 20px;
}

/* Mobile positioning adjustments for left side */
@media (max-width: 768px) {
    .wheel-container.left {
        left: 20px;
        bottom: 100px; /* Above mobile menu and other buttons */
    }
}

.wheel-trigger {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff6b6b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 8px 32px rgba(238, 90, 36, 0.4),
        0 4px 16px rgba(255, 107, 107, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.wheel-trigger:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 
        0 12px 40px rgba(238, 90, 36, 0.6),
        0 6px 20px rgba(255, 107, 107, 0.4),
        inset 0 2px 6px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 1);
}

.wheel-trigger:active {
    transform: scale(1.05) rotate(-5deg);
}

.wheel-trigger:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    transform: rotate(45deg);
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.wheel-trigger:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.5),
        0 0 0 4px rgba(255, 255, 255, 0.2);
}

.wheel-icon {
    font-size: 28px;
    color: white;
    animation: wheel-pulse 2s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}


@keyframes wheel-pulse {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
        filter: brightness(1);
    }
    25% { 
        transform: rotate(90deg) scale(1.1);
        filter: brightness(1.2);
    }
    50% { 
        transform: rotate(180deg) scale(0.9);
        filter: brightness(0.9);
    }
    75% { 
        transform: rotate(270deg) scale(1.1);
        filter: brightness(1.2);
    }
}

.wheel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use opaque-ish overlay to avoid translucent blending artifacts */
    background: transparent;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999998; /* High but below mobile menu */
    animation: fadeIn 0.2s ease;
    contain: layout paint;
    isolation: isolate; /* create new stacking context */
}

.wheel-modal.show {
    display: flex;
}

/* Separate overlay layer to reduce repaints */
.wheel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    will-change: opacity;
    transform: translateZ(0);
    z-index: 0;
}

.wheel-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: slideIn 0.3s ease;
    will-change: transform, opacity;
    transform: translateZ(0);
    z-index: 1; /* Above overlay */
}

/* Prevent underlying content flashing through during transform */
.wheel-svg-container, .wheel-result, .wheel-info, .wheel-title {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

/* On modal open, prevent body scroll jump (JS sets overflow hidden) */
html.modal-open, body.modal-open {
    overflow: hidden !important;
}

@keyframes slideIn {
    from { 
        transform: scale(0.8) translateY(50px);
        opacity: 0;
    }
    to { 
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.wheel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
    z-index: 999999;
    pointer-events: auto;
    touch-action: manipulation;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wheel-close:hover {
    background: #e5e7eb;
    color: #374151;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wheel-title {
    text-align: center;
    margin-bottom: 30px;
}

.wheel-title h2 {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.wheel-title p {
    color: #6b7280;
    font-size: 1.1rem;
}

.wheel-svg-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    position: relative;
}

.wheel-svg {
    width: 300px;
    height: 300px;
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wheel-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #ef4444;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: 4px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.wheel-spin-btn {
    display: block;
    width: 200px;
    margin: 30px auto;
    padding: 15px 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Auth buttons container */
.wheel-auth-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.wheel-login-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

.wheel-register-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3) !important;
}

/* Mobile responsive buttons */
@media (max-width: 768px) {
    .wheel-spin-btn {
        width: 140px;
        padding: 12px 20px;
        font-size: 0.9rem;
        margin: 20px auto;
    }
    
    /* Auth buttons container on mobile */
    .wheel-auth-buttons {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        margin-top: 10px;
    }
    
    .wheel-auth-buttons .wheel-spin-btn {
        width: 120px;
        padding: 10px 16px;
        font-size: 0.85rem;
        margin: 0;
    }
}

.wheel-spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.wheel-login-btn:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4) !important;
}

.wheel-register-btn:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4) !important;
}

.wheel-spin-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wheel-info {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}

.wheel-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.wheel-remaining {
    color: #059669;
    font-weight: 600;
}

.wheel-login-msg {
    color: #dc2626;
    font-weight: 500;
}

.wheel-result {
    text-align: center;
    margin-top: 30px;
    padding: 25px;
    border-radius: 20px;
    display: none;
    animation: bounceIn 0.6s ease;
}

@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; }
}

.wheel-result.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
}

.wheel-result.no-prize {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
}

.wheel-result h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.wheel-result.success h3 {
    color: #065f46;
}

.wheel-result.no-prize h3 {
    color: #991b1b;
}

.wheel-result p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.wheel-result.success p {
    color: #047857;
}

.wheel-result.no-prize p {
    color: #dc2626;
}

.wheel-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    border: 2px solid white;
    z-index: 15;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.wheel-prizes {
    margin-top: 20px;
    text-align: left;
}

.wheel-prizes h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    text-align: center;
}

.wheel-prize-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.wheel-prize-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.wheel-prize-name {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.wheel-prize-chance {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive Tasarım */
@media (max-width: 768px) {
    .wheel-trigger {
        width: 70px;
        height: 70px;
    }
    
    .wheel-icon {
        font-size: 28px;
    }
    
    .wheel-content {
        padding: 25px;
        margin: 20px;
    }
    
    .wheel-svg {
        width: 250px;
        height: 250px;
    }
    
    .wheel-title h2 {
        font-size: 1.5rem;
    }
    
    .wheel-container.right,
    .wheel-container.left {
        bottom: 80px;
        right: 15px;
        left: auto;
    }
}

@media (max-width: 480px) {
    .wheel-trigger {
        width: 60px;
        height: 60px;
    }
    
    .wheel-icon {
        font-size: 24px;
    }
    
    .wheel-svg {
        width: 200px;
        height: 200px;
    }
    
    .wheel-content {
        padding: 20px;
        margin: 10px;
    }
}

/* Dark Mode Desteği */
@media (prefers-color-scheme: dark) {
    .wheel-content {
        background: #1f2937;
        color: white;
    }
    
    .wheel-title h2 {
        color: white;
    }
    
    .wheel-title p {
        color: #d1d5db;
    }
    
    .wheel-close {
        background: #374151;
        color: #d1d5db;
    }
    
    .wheel-close:hover {
        background: #4b5563;
        color: white;
    }
    
    .wheel-info {
        background: #374151;
        border-color: #4b5563;
    }
    
    .wheel-info h3 {
        color: white;
    }
    
    .wheel-prize-item {
        background: #374151;
        border-color: #4b5563;
    }
    
    .wheel-prize-name {
        color: white;
    }
    
    .wheel-prize-chance {
        color: #d1d5db;
    }
}

/* Animasyonlar */
.wheel-spinning {
    pointer-events: none;
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f39c12;
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.confetti:nth-child(odd) {
    background: #e74c3c;
    animation-delay: 0.5s;
}

.confetti:nth-child(even) {
    background: #3498db;
    animation-delay: 1s;
}

/* Yükleme Animasyonu */
.wheel-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.wheel-loading.show {
    display: block;
}

.wheel-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Class-based Dark Mode (Tailwind 'dark' class) */
.dark .wheel-content {
    background: #1f2937;
    color: #e5e7eb;
}

.dark .wheel-title h2 {
    color: #f3f4f6;
}

.dark .wheel-title p {
    color: #d1d5db;
}

.dark .wheel-close {
    background: #374151;
    color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark .wheel-close:hover {
    background: #4b5563;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dark .wheel-info {
    background: #374151;
    border-color: #4b5563;
}

.dark .wheel-info h3 {
    color: #f3f4f6;
}

.dark .wheel-prize-item {
    background: #374151;
    border-color: #4b5563;
}

.dark .wheel-prize-name {
    color: #f3f4f6;
}

.dark .wheel-prize-chance {
    color: #d1d5db;
}

/* Result cards - better contrast in dark */
.dark .wheel-result.success {
    background: linear-gradient(135deg, rgba(16,185,129,0.15) 0%, rgba(5,150,105,0.15) 100%);
    border: 2px solid #10b981;
}

.dark .wheel-result.no-prize {
    background: linear-gradient(135deg, rgba(239,68,68,0.15) 0%, rgba(220,38,38,0.15) 100%);
    border: 2px solid #ef4444;
}

.dark .wheel-result h3 {
    color: #f3f4f6;
}

.dark .wheel-result.success p {
    color: #a7f3d0;
}

.dark .wheel-result.no-prize p {
    color: #fecaca;
}

/* Pointer and center look fine but ensure center ring stands out on dark */
.dark .wheel-center {
    border-color: #e5e7eb;
}

/* Trigger button subtle border on dark backgrounds */
.dark .wheel-trigger {
    border-color: rgba(255,255,255,0.6);
}
