/* استيراد خط Zain من Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Zain:wght@200;300;400;700;800;900&display=swap');

/* تطبيق الخط الافتراضي */
body, h1, h2, h3, h4, h5, h6, p, a, input, button, select {
    font-family: "Zain", serif;
    margin: 0;
    padding: 0;
    color: #333; /* لون النص الافتراضي */
}

/* تحسين العناوين */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700; /* افتراضي: الخط الغامق */
    color: #1f2937; /* لون رمادي غامق */
    margin-bottom: 1rem;
}

/* تحسين الروابط */
a {
    text-decoration: none;
    color: #4f46e5; /* لون أزرق بنفسجي */
}
a:hover {
    color: #4338ca; /* لون أغمق عند التمرير */
}

/* تحسين الأزرار */
button, .btn {
    font-family: "Zain", serif;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}
button:hover, .btn:hover {
    background-color: #4338ca;
    transform: scale(1.05); /* تأثير خفيف عند التمرير */
}

/* تحسين الحقول النصية */
input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #4f46e5; /* لون التركيز */
}

/* تنسيق الكارد */
.card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: 1.5rem;
}

/* تحسين الرسائل */
.alert {
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5; /* لون أخضر فاتح */
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2; /* لون أحمر فاتح */
    color: #b91c1c;
}

/* CSS Classes for Zain */
.zain-extralight {
    font-family: "Zain", serif;
    font-weight: 200;
    font-style: normal;
}

.zain-light {
    font-family: "Zain", serif;
    font-weight: 300;
    font-style: normal;
}

.zain-regular {
    font-family: "Zain", serif;
    font-weight: 400;
    font-style: normal;
}

.zain-bold {
    font-family: "Zain", serif;
    font-weight: 700;
    font-style: normal;
}

.zain-extrabold {
    font-family: "Zain", serif;
    font-weight: 800;
    font-style: normal;
}

.zain-black {
    font-family: "Zain", serif;
    font-weight: 900;
    font-style: normal;
}
/* جعل النصوص داخل label بخط غامق */
label {
    font-family: "Zain", serif;
    font-weight: 700; /* الخط الغامق */
    font-size: 1rem; /* حجم النص (اختياري) */
    color: #1f2937; /* لون النص الافتراضي */
    margin-bottom: 0.5rem; /* إضافة مسافة تحت الـ label لتحسين التباعد */
}
/* حاوية الرسائل */
#usernameSuggestion {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9; /* خلفية رمادية فاتحة */
    font-size: 0.9rem; /* حجم نص صغير قليلاً */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* ظل خفيف */
}

/* النصوص */
#usernameSuggestion span {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333; /* لون النص الأساسي */
}

/* تنسيق قائمة الاقتراحات */
#usernameSuggestion ul {
    list-style: none; /* إزالة النقط */
    padding: 0;
    margin: 0;
}

#usernameSuggestion ul li {
    padding: 8px;
    margin-bottom: 5px;
    background-color: #eaf4ff; /* خلفية زرقاء فاتحة */
    border: 1px solid #bee3ff; /* حدود زرقاء فاتحة */
    border-radius: 3px; /* حواف دائرية */
    font-size: 0.9rem; /* حجم نص صغير */
    transition: all 0.2s ease-in-out; /* تأثير انتقال */
    cursor: pointer; /* مؤشر اليد عند المرور */
    color: #0056b3; /* لون النص */
}

/* تأثير عند تمرير الفأرة */
#usernameSuggestion ul li:hover {
    background-color: #d1eaff; /* لون أزرق أكثر وضوحاً عند التمرير */
    border-color: #0056b3; /* حدود أغمق */
    color: #003f7f; /* لون النص أغمق */
    transform: scale(1.02); /* تكبير بسيط */
}

/* نص الرسالة عند اختيار اسم */
#usernameSuggestion .success-message {
    color: #28a745; /* لون أخضر */
    font-weight: bold;
    margin-top: 10px;
}

/***************************************************************
 *                      LOGIN & REGISTER PAGES STYLING
 ***************************************************************/

/* صفحة الدخول والتسجيل */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 0;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: "Zain", serif;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #a0aec0;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: "Zain", serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-auth:active {
    transform: translateY(0);
}

.auth-links {
    text-align: center;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #4c51bf;
    text-decoration: underline;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #a0aec0;
    font-size: 0.9rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* تحسين الرسائل */
.alert {
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    border: none;
    font-weight: 500;
}

.alert-success {
    background-color: #f0fff4;
    color: #22543d;
    border-left: 4px solid #38a169;
}

.alert-danger {
    background-color: #fff5f5;
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

/* تحسين suggestions للأسماء */
#usernameSuggestion {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background-color: #f8fafc;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#usernameSuggestion span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2d3748;
}

#usernameSuggestion ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#usernameSuggestion ul li {
    padding: 8px 12px;
    margin-bottom: 0.5rem;
    background-color: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #4a5568;
}

#usernameSuggestion ul li:hover {
    background-color: #e6fffa;
    border-color: #38b2ac;
    color: #234e52;
    transform: translateX(-2px);
}

/***************************************************************
 *                      RESPONSIVE DESIGN FOR MOBILE
 ***************************************************************/

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .auth-page {
        padding: 15px;
        min-height: 100vh;
    }

    .auth-container {
        padding: 2rem 1.5rem;
        margin: 10px auto;
        border-radius: 16px;
        max-width: 100%;
        width: 100%;
    }

    .auth-title {
        font-size: 1.6rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }

    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* منع التكبير التلقائي في iOS */
    }

    .btn-auth {
        padding: 16px;
        font-size: 1.1rem;
    }

    .auth-logo {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem 1rem;
        margin: 5px auto;
        border-radius: 12px;
    }

    .auth-title {
        font-size: 1.4rem;
    }

    .form-control {
        padding: 12px 14px;
    }

    .btn-auth {
        padding: 14px;
        font-size: 1rem;
    }
}

/* تحسين الصفحات العادية للهاتف */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
    }

    .username-display, 
    .email-display,
    .points-display {
        font-size: 1.1rem;
    }

    .container {
        padding: 20px;
    }
}