/* ==========================================================================
   Wheel of Luck Frontend Styles
   ========================================================================== */

/* Persian Font Import */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* Base Styles */
.wol-container {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #333;
}

.wol-container * {
    box-sizing: border-box;
}

/* Registration Section */
.wol-registration-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.wol-registration-section h3 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 25px 0;
    text-align: center;
}

/* Form Styles */
.wol-form {
    max-width: 400px;
    margin: 0 auto;
}

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

.wol-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #34495e;
    font-size: 14px;
}

.wol-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
    background: #fff;
}

.wol-form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.wol-form-group input:invalid {
    border-color: #e74c3c;
}

.wol-help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

/* Button Styles */
.wol-btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.wol-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wol-btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.wol-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.wol-btn-success {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.wol-btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.wol-btn-large {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
}

.wol-btn .wol-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.wol-btn.loading .wol-btn-text {
    display: none;
}

.wol-btn.loading .wol-loading {
    display: flex;
}

/* Spinner Animation */
.wol-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: wol-spin 0.8s linear infinite;
}

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

/* Wheel Section */
.wol-wheel-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.wol-wheel-section h3 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 25px 0;
}

.wol-wheel-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    /* این بخش برای ریسپانسیو شدن مهم است */
    max-width: 100%;
}

#wol-wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    background: #fff;
    /* این بخش برای ریسپانسیو شدن canvas مهم است */
    max-width: 100%;
    height: auto;
}

.wol-wheel-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* این خط را از حالت ایستا خارج کرده و به مرکز می‌آورد */
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid #e74c3c;
    z-index: 10;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.wol-wheel-controls {
    margin-top: 20px;
    text-align: center;
}

/* Messages */
.wol-messages {
    margin-top: 20px;
}

.wol-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    text-align: center;
}

.wol-message-success {
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wol-message-error {
    background: linear-gradient(45deg, #f8d7da, #f1c2c7);
    color: #721c24;
    border: 1px solid #f1c2c7;
}

.wol-message-info {
    background: linear-gradient(45deg, #d1ecf1, #b8daff);
    color: #0c5460;
    border: 1px solid #b8daff;
}

/* Modal Styles */
.wol-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.wol-modal-content {
    background: #fff;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: wol-modal-appear 0.3s ease-out;
}

@keyframes wol-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wol-modal-header {
    padding: 20px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    position: relative;
}

.wol-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.wol-modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.wol-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wol-modal-body {
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.wol-confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.wol-prize-announcement {
    position: relative;
    z-index: 2;
}

.wol-trophy-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: wol-trophy-bounce 0.6s ease-out;
}

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

.wol-prize-announcement h3 {
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.wol-prize-name {
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
    margin: 15px 0;
    padding: 10px 20px;
    background: linear-gradient(45deg, #fff5f5, #ffe6e6);
    border-radius: 8px;
    border: 2px solid #e74c3c;
}

.wol-prize-message {
    color: #7f8c8d;
    font-size: 14px;
    margin: 15px 0 0 0;
}

.wol-modal-footer {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
}

/* Shortcode Title */
.wol-shortcode-title {
    text-align: center;
    margin-bottom: 20px;
}

.wol-shortcode-title h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wol-container {
        padding: 15px;
        margin: 10px;
    }
    
    .wol-registration-section,
    .wol-wheel-section {
        padding: 20px;
    }
    
    .wol-registration-section h3,
    .wol-wheel-section h3 {
        font-size: 20px;
    }
    
    #wol-wheel-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .wol-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .wol-modal-content {
        width: 95%;
    }
    
    .wol-modal-body {
        padding: 20px;
    }
    
    .wol-shortcode-title h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .wol-container {
        padding: 10px;
    }
    
    .wol-registration-section,
    .wol-wheel-section {
        padding: 15px;
    }
    
    .wol-form-group input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .wol-btn-large {
        padding: 12px 25px;
        font-size: 16px;
    }
}

/* Print Styles */
@media print {
    .wol-container {
        background: none;
        box-shadow: none;
        color: #000;
    }
    
    .wol-btn,
    .wol-modal {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wol-container {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
    
    .wol-btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}