/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 0px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Alert Messages */
.alert {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.alert-warning {
    border-left: 5px solid #f39c12;
}

.alert h2 {
    color: #e67e22;
    margin-bottom: 10px;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Form Section */
.form-section {
    max-width: 500px;
    margin: 0 auto;
}

.form-section h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #27ae60;
    color: white;
    width: 100%;
}

.btn-success:hover {
    background: #229954;
}

/* Wheel Section */
.wheel-section {
    text-align: center;
    position: relative;
}

.user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.user-info p {
    margin: 5px 0;
    color: #555;
}

.wheel-section h2 {
    color: #667eea;
    margin-bottom: 30px;
}

.btn-back {
    position: absolute;
    top: 0;
    left: 0;
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #7f8c8d;
}

.wheel-container {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 0 auto 30px;
}

.wheel-image {
    width: 100%;
    height: 100%;
    transition: transform 5s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: block;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #e74c3c;
    z-index: 5;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.3));
}

.spin-btn {
    display: block;
    margin: 30px auto 20px;
    width: 200px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.instruction {
    color: #666;
    font-size: 18px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

.modal-undismissable {
    background-color: rgba(0,0,0,0.9);
    pointer-events: auto;
}

.modal-undismissable .modal-content {
    pointer-events: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    animation: slideIn 0.3s;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.prize-image {
    font-size: 80px;
    margin: 20px 0;
}

.prize-name {
    font-size: 24px;
    font-weight: bold;
    color: #27ae60;
    margin: 20px 0;
}

.no-prize-message {
    font-size: 20px;
    color: #e74c3c;
    margin: 20px 0;
}

/* Upload Loading Overlay */
.upload-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.upload-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.upload-loading-text {
    color: white;
    font-size: 18px;
    margin-top: 20px;
    text-align: center;
}

.upload-loading-text .dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

.upload-loading-text .dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .wheel-container {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    #wheelCanvas {
        width: 100% !important;
        height: auto !important;
    }
    
    .spin-btn {
        width: 80px;
        height: 80px;
        font-size: 16px;
    }
}
