/* Enhanced Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e1f4ff 100%);
    min-height: 100vh;
    color: #2d3748;
}

/* Enhanced Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(76, 175, 80, 0.1);
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Enhanced Prize Grid */
.prize-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.prize-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.prize-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

.prize-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #45a049);
}

/* Enhanced Wheel Container */
.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 40px auto;
    perspective: 1000px;
}

.wheel-pointer {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #ff4444, #cc0000);
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.wheel-canvas {
    width: 100%;
    height: 100%;
    transition: transform 4s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

/* Enhanced Prize Result */
.prize-result {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.prize-name {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #1b5e20, #2e7d32);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Button Styles */
.spin-button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 18px 48px;
    font-size: 1.3rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(76, 175, 80, 0.25);
    position: relative;
    overflow: hidden;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(76, 175, 80, 0.3);
}

.spin-button:active:not(:disabled) {
    transform: translateY(1px);
}

.spin-button:disabled {
    background: linear-gradient(45deg, #9e9e9e, #757575);
    cursor: not-allowed;
    transform: none;
}

.spin-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s;
}

.spin-button:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Enhanced Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Enhanced Error Message */
.error-message {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 8px 16px rgba(198, 40, 40, 0.1);
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Enhanced Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #323232, #1a1a1a);
    color: white;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(100%) scale(0.9);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .wheel-container {
        width: 350px;
        height: 350px;
    }

    .prize-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .prize-name {
        font-size: 2rem;
    }

    .spin-button {
        padding: 16px 36px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .wheel-container {
        width: 300px;
        height: 300px;
    }

    .wheel-pointer {
        width: 40px;
        height: 40px;
        top: -20px;
    }

    .prize-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .prize-item {
        padding: 15px;
    }

    .prize-name {
        font-size: 1.8rem;
    }

    .spin-button {
        padding: 14px 32px;
        font-size: 1.1rem;
    }

    .prize-result {
        padding: 30px;
        margin: 0 20px;
    }
}

/* Enhanced Container and Layout */
.container {
    max-width: 1200px;
    padding: 20px;
    margin: 0 auto;
}

/* Enhanced Form Elements */
input, select {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

input:focus, select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Enhanced Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #45a049, #388e3c);
}

/* Enhanced Active Links Section */
.active-link {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.active-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

/* Enhanced Header Section */
.header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(76, 175, 80, 0.2);
}

/* Enhanced Animation Performance */
.wheel-canvas {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}

/* Enhanced Card Styles */
.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}