/**
 * Frontend CSS for IR Basketball Plugin
 * RTL-ready styles for Persian/Farsi content
 */

/* Container and Layout */
.ir-basketball-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
    text-align: right;
    font-family: 'Tahoma', 'Iranian Sans', 'Vazir', sans-serif;
}

.ir-basketball-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: white;
    border-radius: 8px;
}

.ir-basketball-form-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: bold;
}

.ir-basketball-form-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Form Styling */
.ir-basketball-form {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Multi-step Form */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.form-step.active {
    display: block;
}

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

.form-step h3 {
    color: #e67e22;
    font-size: 22px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e67e22;
    padding-bottom: 10px;
    text-align: center;
}

/* Form Groups and Rows */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group.half {
    flex: 1;
}

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

.required {
    color: #e74c3c;
    margin-right: 3px;
}

/* Form Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
    transform: translateY(-1px);
}

.form-group input::placeholder {
    color: #95a5a6;
    text-align: right;
}

/* Role Selection */
.role-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.role-option {
    position: relative;
}

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.role-card {
    display: block;
    padding: 20px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: #ffffff;
    min-height: 120px;
}

.role-card:hover {
    border-color: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.2);
}

.role-option input[type="radio"]:checked + .role-card {
    border-color: #e67e22;
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: white;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.role-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.role-name {
    font-size: 16px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.role-description {
    font-size: 12px;
    opacity: 0.8;
    display: block;
}

/* Verification Section */
.verification-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border-right: 4px solid #e67e22;
}

.verification-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
}

.verification-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.verification-group input {
    flex: 1;
    min-width: 150px;
}

.verification-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.verification-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.verification-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.verification-status.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #e67e22;
    color: #e67e22;
}

.btn-outline:hover {
    background: #e67e22;
    color: white;
}

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

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.form-actions .btn {
    margin: 0 10px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-left: 10px;
    transform: scale(1.2);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e67e22;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.form-footer a {
    color: #e67e22;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.progress-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #bdc3c7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 15px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #e67e22;
}

.progress-step.completed {
    background: #27ae60;
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ir-basketball-form-container {
        padding: 15px;
    }
    
    .ir-basketball-form {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .role-selection {
        grid-template-columns: 1fr;
    }
    
    .verification-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .verification-group .btn {
        margin: 5px 0;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .ir-basketball-form-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .ir-basketball-form-container {
        padding: 10px;
    }
    
    .ir-basketball-form {
        padding: 15px;
    }
    
    .ir-basketball-form-header {
        padding: 15px;
    }
    
    .ir-basketball-form-header h2 {
        font-size: 20px;
    }
    
    .role-card {
        min-height: 100px;
        padding: 15px;
    }
    
    .role-icon {
        font-size: 24px;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for keyboard navigation */
.btn:focus,
.role-card:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(230, 126, 34, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ir-basketball-form {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .role-card {
        border: 2px solid #000;
    }
}