/**
 * Frontend CSS for Smart Lottery Plugin
 */

/* Persian Font Import */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* Main Container */
.smart-lottery-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 30px;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    position: relative;
    overflow: hidden;
    direction: rtl;
    text-align: right;
}

.smart-lottery-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Title and Subtitle */
.smart-lottery-title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 15px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.smart-lottery-subtitle {
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 30px;
    font-size: 18px;
    line-height: 1.5;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    font-weight: 400;
}

/* Form Fields */
.smart-lottery-fields {
    margin-bottom: 25px;
}

.smart-lottery-field {
    margin-bottom: 20px;
}

.smart-lottery-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 16px;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
}

.smart-lottery-field input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fafbfc;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
}

.smart-lottery-field input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.smart-lottery-field input.error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

.smart-lottery-field input.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Submit Button */
.smart-lottery-submit {
    margin-top: 25px;
}

.smart-lottery-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: center;
}

.smart-lottery-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.smart-lottery-btn:active {
    transform: translateY(0);
}

/* Sponsor and Social Sections */
.smart-lottery-sponsor,
.smart-lottery-social {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 16px;
    color: #6c757d;
    border-right: 4px solid #667eea;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
}

.smart-lottery-sponsor a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.smart-lottery-sponsor a:hover {
    text-decoration: underline;
}

/* Progress Container */
.smart-lottery-progress-container {
    text-align: center;
    padding: 40px 20px;
}

.smart-lottery-progress-content h3 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 22px;
    font-weight: 600;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: center;
}

.smart-lottery-progress-bar {
    width: 100%;
    height: 25px;
    background: #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    margin: 30px 0;
    position: relative;
}

.smart-lottery-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 12px;
    position: relative;
}

.smart-lottery-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.smart-lottery-progress-text {
    color: #7f8c8d;
    font-size: 14px;
    margin-top: 15px;
}

/* Success Container */
.smart-lottery-success-container {
    text-align: center;
    padding: 40px 20px;
}

.smart-lottery-success-content h3 {
    color: #27ae60;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: center;
}

.smart-lottery-success-icon {
    font-size: 60px;
    color: #27ae60;
    margin: 20px 0;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Error Messages */
.smart-lottery-error {
    background: #fdf2f2;
    color: #e74c3c;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Popup Styles */
#smart-lottery-popup {
    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;
    padding: 20px;
    box-sizing: border-box;
}

#smart-lottery-popup .smart-lottery-container {
    max-width: 600px;
    margin: 0;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .smart-lottery-container {
        margin: 10px;
        padding: 20px;
        border-radius: 10px;
    }
    
    .smart-lottery-title {
        font-size: 24px;
    }
    
    .smart-lottery-subtitle {
        font-size: 14px;
    }
    
    .smart-lottery-field input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .smart-lottery-btn {
        padding: 15px;
        font-size: 16px;
    }
    
    #smart-lottery-popup {
        padding: 10px;
    }
    
    #smart-lottery-popup .smart-lottery-container {
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .smart-lottery-container {
        padding: 15px;
    }
    
    .smart-lottery-title {
        font-size: 20px;
    }
    
    .smart-lottery-progress-content h3 {
        font-size: 18px;
    }
    
    .smart-lottery-success-content h3 {
        font-size: 20px;
    }
}

/* RTL Support */
.rtl .smart-lottery-container {
    direction: rtl;
    text-align: right;
}

.rtl .smart-lottery-field input {
    text-align: right;
}

.rtl .smart-lottery-title,
.rtl .smart-lottery-subtitle {
    text-align: center;
}

/* Print Styles */
@media print {
    .smart-lottery-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .smart-lottery-btn {
        background: #ccc !important;
        color: #000 !important;
    }
}

/* Sponsor and Social Media Link Styles */
.smart-lottery-sponsor a,
.smart-lottery-social a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.smart-lottery-sponsor a:hover,
.smart-lottery-social a:hover {
    color: #005a87;
    text-decoration: underline;
}

.smart-lottery-sponsor a[rel="sponsored"] {
    position: relative;
}

.smart-lottery-sponsor a[rel="sponsored"]:after,
.smart-lottery-social a[rel="sponsored"]:after {
    content: " (اسپانسر)";
    font-size: 11px;
    color: #999;
    font-weight: normal;
}

.smart-lottery-social a {
    display: inline-block;
    padding: 5px 10px;
    background: #f0f8ff;
    border-radius: 4px;
    border: 1px solid #b3d9ff;
    transition: all 0.3s ease;
}

.smart-lottery-social a:hover {
    background: #e7f3ff;
    border-color: #007cba;
    transform: translateY(-1px);
}
