
/* 
 * ملف CSS للمصادقة
 * المركز الجامعي عبد الحفيظ بوف
 * دعم اللغة العربية والاتجاه من اليمين إلى اليسار
 */

/* خطوط عربية */
body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
}

/* خلفية صفحة المصادقة */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Cairo', sans-serif;
}

/* جانب العلامة التجارية */
.auth-brand-side {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%),
                url('../../assets/images/university-bg.jpg') center/cover;
    position: relative;
    overflow: hidden;
}

.auth-brand-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.auth-brand-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}

.auth-logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.auth-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.feature-item i {
    color: #ffd700;
    margin-bottom: 1rem;
}

.feature-item h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin: 0;
}

/* حاوي النموذج */
.auth-form-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
}

.auth-form {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.auth-title {
    color: #333;
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* حقول النموذج */
.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.form-label i {
    color: #667eea;
    margin-left: 0.5rem;
}

.form-control {
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
}

.form-control:hover {
    border-color: #667eea;
    background: white;
}

/* أزرار */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 10px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* بطاقات نوع المستخدم */
.user-type-card {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.user-type-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.user-type-card input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.user-type-card input[type="radio"] {
    display: none;
}

.user-type-card label {
    cursor: pointer;
    margin: 0;
    padding: 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.user-type-card i {
    color: #667eea;
    margin-bottom: 1rem;
}

.user-type-card input[type="radio"]:checked + label i {
    color: #ffd700;
}

/* تنبيهات */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
}

.alert i {
    margin-left: 0.5rem;
}

/* مجموعة الإدخال */
.input-group .btn {
    border-radius: 0 10px 10px 0;
    border: 2px solid #e1e5e9;
    border-right: none;
}

.input-group .form-control {
    border-radius: 10px 0 0 10px;
    border-left: none;
}

.input-group .form-control:focus + .btn {
    border-color: #667eea;
}

/* تذييل المصادقة */
.auth-footer {
    border-top: 1px solid #e1e5e9;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

.auth-footer a {
    color: #667eea;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #764ba2;
}

/* ============================================== */
/* التعديلات الجديدة المضافة */
/* ============================================== */

/* تنسيقات لحقول الإدخال الصالحة وغير الصالحة */
.form-control.is-valid {
    border-color: #198754;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
    padding-left: 2.5rem;
}

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6.4.4.4-.4'/%3e%3cpath d='M6 7v1'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
    padding-left: 2.5rem;
}

/* تعديلات للعربية - وضع الأيقونات على اليسار */
.form-control.is-valid,
.form-control.is-invalid {
    background-position: right calc(.375em + .1875rem) center;
    padding-right: 2.5rem;
    padding-left: 1rem;
}

/* رسائل التحقق */
.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #198754;
    text-align: right;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
    text-align: right;
}

.was-validated .form-control:valid ~ .valid-feedback,
.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-valid ~ .valid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* تلميحات البريد الإلكتروني للأساتذة */
.professor-email-hint {
    background-color: #e7f1ff;
    border: 1px solid #b3d4fc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #2c5aa0;
    text-align: right;
}

.professor-email-hint:before {
    content: "💡";
    margin-left: 0.5rem;
}

/* تنسيقات التحقق من رقم الهاتف */
.phone-format-hint {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #856404;
    text-align: right;
}

.phone-format-hint:before {
    content: "📱";
    margin-left: 0.5rem;
}

/* تنسيقات التحقق في الوقت الحقيقي */
.real-time-validation {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    text-align: right;
}

.phone-valid {
    color: #198754;
    font-weight: 600;
}

.phone-valid:before {
    content: "✓ رقم الهاتف صحيح";
    margin-left: 0.25rem;
}

.phone-invalid {
    color: #dc3545;
    font-weight: 600;
}

.phone-invalid:before {
    content: "✗ رقم الهاتف غير صحيح";
    margin-left: 0.25rem;
}

.email-valid {
    color: #198754;
    font-weight: 600;
}

.email-invalid {
    color: #dc3545;
    font-weight: 600;
}

.email-valid:before {
    content: "✓ ";
    margin-left: 0.25rem;
}

.email-invalid:before {
    content: "✗ ";
    margin-left: 0.25rem;
}

/* حقول الطلاب المخفية */
.student-field {
    transition: all 0.4s ease-in-out;
}

.student-field.show {
    display: block !important;
    animation: slideDown 0.4s ease-out;
}

.student-field.hide {
    display: none !important;
}

/* تأثيرات الظهور والاختفاء */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
    .auth-form-container {
        padding: 1rem;
    }
    
    .auth-form {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .user-type-card {
        margin-bottom: 1rem;
    }
    
    .feature-item {
        padding: 1rem;
    }
    
    /* تعديلات للجوال */
    .form-control.is-valid,
    .form-control.is-invalid {
        background-size: calc(.6em + .3rem) calc(.6em + .3rem);
        padding-right: 2.2rem;
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1200px) {
    .auth-form {
        padding: 3rem;
    }
    
    .auth-title {
        font-size: 2.5rem;
    }
}

/* تأثيرات الحركة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form {
    animation: fadeInUp 0.6s ease-out;
}

.feature-item {
    animation: fadeInUp 0.6s ease-out;
}

.feature-item:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-item:nth-child(3) {
    animation-delay: 0.4s;
}

/* تحسينات إضافية للعربية */
.form-text {
    text-align: right;
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
}

.text-muted {
    color: #6c757d !important;
}

/* تحسين الأزرار للعربية */
.btn i {
    margin-left: 0.5rem;
}

/* تحسين التنبيهات */
.alert-dismissible .btn-close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

/* تحسين مجموعة الإدخال للعربية */
.input-group .btn-outline-secondary {
    color: #6c757d;
    border-color: #e1e5e9;
}

.input-group .btn-outline-secondary:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* تحسين الروابط */
a.text-decoration-none {
    transition: all 0.3s ease;
}

a.text-decoration-none:hover {
    text-decoration: underline !important;
}

/* تحسين الشبكة للعربية */
.row {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col-6, .col-md-6 {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}
