/* Custom Modal Styles */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: modalFadeIn 0.3s ease-out;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.custom-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    min-width: 50vw;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.custom-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.custom-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 44px; /* Touch-friendly minimum width */
    min-height: 44px; /* Touch-friendly minimum height */
    touch-action: manipulation; /* Optimize for touch */
}

.custom-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

    .custom-modal-body {
        padding: 25px;
        overflow-y: auto;
        max-height: calc(90vh - 80px);
    }
    
    /* Ensure wheel container is properly centered */
    .wheel-container {
        position: relative;
        width: 380px;
        height: 380px;
        margin: 0 auto;
    }
    
    /* Desktop wheel size (default) */
    .wheel {
        width: 380px;
        height: 380px;
    }

/* Congratulations Modal Specific Styles */
.congrats-content {
    max-width: 500px;
    text-align: center;
}

.congrats-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out;
}

.prize-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    animation: slideInUp 0.5s ease-out 0.2s both;
}

.prize-description {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.6;
    animation: slideInUp 0.5s ease-out 0.4s both;
}

.congrats-actions {
    animation: slideInUp 0.5s ease-out 0.6s both;
}

.congrats-actions .btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.congrats-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-modal-content {
        max-width: 95vw;
        margin: 10px;
        border-radius: 15px;
    }
    
    .custom-modal-header {
        padding: 15px 20px 10px;
    }
    
    .custom-modal-title {
        font-size: 1.3rem;
    }
    
    .custom-modal-body {
        padding: 20px;
    }
    
    .congrats-icon {
        font-size: 3rem;
    }
    
    .prize-name {
        font-size: 1.5rem;
    }
    
    .prize-description {
        font-size: 1rem;
    }
    
    /* Wheel specific mobile styles */
    .wheel-container {
        width: 320px !important;
        height: 320px !important;
        margin: 0 auto 15px;
    }
    
    .wheel {
        width: 320px !important;
        height: 320px !important;
    }
    
    .pointer {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 18px solid #e74c3c;
        top: -8px;
    }
    
    .spin-button {
        padding: 12px 30px;
        font-size: 1.1rem;
        width: 100%;
        max-width: 200px;
        min-height: 44px; /* Touch-friendly minimum height */
        touch-action: manipulation; /* Optimize for touch */
    }
}

@media (max-width: 480px) {
    .custom-modal-content {
        max-width: 98vw;
        margin: 5px;
        border-radius: 12px;
    }
    
    .custom-modal-header {
        padding: 12px 15px 8px;
    }
    
    .custom-modal-title {
        font-size: 1.1rem;
    }
    
    .custom-modal-body {
        padding: 15px;
    }
    
    .congrats-icon {
        font-size: 2.5rem;
    }
    
    .prize-name {
        font-size: 1.3rem;
    }
    
    /* Wheel specific small mobile styles */
    .wheel-container {
        width: 280px !important;
        height: 280px !important;
        margin: 0 auto 10px;
    }
    
    .wheel {
        width: 280px !important;
        height: 280px !important;
        border: 6px solid #fff;
    }
    
    .pointer {
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 15px solid #e74c3c;
        top: -6px;
    }
    
    .spin-button {
        padding: 10px 25px;
        font-size: 1rem;
        width: 100%;
        max-width: 180px;
        min-height: 44px; /* Touch-friendly minimum height */
        touch-action: manipulation; /* Optimize for touch */
    }
    
    /* Adjust text size in wheel segments */
    #wheel svg text {
        font-size: 12px !important;
    }
}

@media (max-width: 360px) {
    .custom-modal-content {
        max-width: 99vw;
        margin: 2px;
        border-radius: 10px;
    }
    
    .custom-modal-header {
        padding: 10px 12px 6px;
    }
    
    .custom-modal-title {
        font-size: 1rem;
    }
    
    .custom-modal-body {
        padding: 12px;
    }
    
    /* Wheel specific very small mobile styles */
    .wheel-container {
        width: 240px !important;
        height: 240px !important;
        margin: 0 auto 8px;
    }
    
    .wheel {
        width: 240px !important;
        height: 240px !important;
        border: 4px solid #fff;
    }
    
    .pointer {
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 12px solid #e74c3c;
        top: -4px;
    }
    
    .spin-button {
        padding: 8px 20px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 150px;
        min-height: 44px; /* Touch-friendly minimum height */
        touch-action: manipulation; /* Optimize for touch */
    }
    
    /* Adjust text size in wheel segments */
    #wheel svg text {
        font-size: 10px !important;
    }
}
