/* ============================================
   نظام الألوان البنفسجي الخفيف
   ============================================ */
:root {
    --primary-color: #9D84C7;
    --primary-light: #BFA9E5;
    --primary-dark: #7B5FA8;
    --secondary-color: #C7A4D8;
    --accent-color: #E8D5F2;
    --success-color: #A8D8B9;
    --error-color: #E89A9A;
    --warning-color: #F5D19A;
    --text-dark: #4A4063;
    --text-light: #8B7AA8;
    --bg-light: #F8F5FC;
    --white: #FFFFFF;
    --shadow: rgba(157, 132, 199, 0.15);
}

/* ============================================
   إعدادات عامة
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Cairo', Tahoma, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 50%, var(--bg-light) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* تأثير خلفية متحركة */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(157, 132, 199, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
    z-index: 0;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ============================================
   صندوق النموذج الرئيسي
   ============================================ */
.form-wrapper {
    background: var(--white);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow);
    max-width: 480px;
    width: 100%;
    animation: slideUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(157, 132, 199, 0.1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   شعار المنصة
   ============================================ */
.logo-section {
    text-align: center;
    margin-bottom: 35px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--white);
    box-shadow: 0 10px 30px rgba(157, 132, 199, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo-section h1 {
    color: var(--primary-dark);
    font-size: 32px;
    margin-bottom: 5px;
    font-weight: 700;
}

.tagline {
    color: var(--text-light);
    font-size: 14px;
}

/* ============================================
   رسائل النظام
   ============================================ */
.error-message,
.success-message {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    animation: shake 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
}

.error-message {
    background: linear-gradient(135deg, var(--error-color), #F5B5B5);
    color: #7A3030;
    border: 2px solid rgba(232, 154, 154, 0.3);
}

.success-message {
    background: linear-gradient(135deg, var(--success-color), #C8E6D3);
    color: #2D5A3D;
    border: 2px solid rgba(168, 216, 185, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ============================================
   عناوين الصفحات
   ============================================ */
h2 {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 30px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

h2 i {
    color: var(--primary-color);
}

/* ============================================
   اختيار الأفاتار
   ============================================ */
.avatar-selection {
    margin-bottom: 25px;
    text-align: center;
}

.avatar-label {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 15px;
}

.avatar-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.avatar-option {
    cursor: pointer;
    flex: 1;
    max-width: 150px;
}

.avatar-option input[type="radio"] {
    display: none;
}

.avatar-box {
    padding: 25px 15px;
    border-radius: 15px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
}

.avatar-box i {
    font-size: 48px;
}

.avatar-box span {
    font-size: 14px;
    font-weight: 600;
}

.male-avatar {
    color: #6BA4E8;
}

.female-avatar {
    color: #E88BB4;
}

.avatar-option input[type="radio"]:checked + .avatar-box {
    transform: scale(1.05);
    box-shadow: 0 10px 30px var(--shadow);
}

.avatar-option input[type="radio"]:checked + .male-avatar {
    border-color: #6BA4E8;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
}

.avatar-option input[type="radio"]:checked + .female-avatar {
    border-color: #E88BB4;
    background: linear-gradient(135deg, #FCE4EC, #F8BBD0);
}

/* ============================================
   عناصر النموذج
   ============================================ */
.form-control {
    margin-bottom: 20px;
}

.form-control label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-control label i {
    color: var(--primary-color);
    font-size: 16px;
}

.form-control input[type="text"],
.form-control input[type="email"],
.form-control input[type="tel"],
.form-control input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--bg-light);
    color: var(--text-dark);
}

.form-control input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(157, 132, 199, 0.1);
    transform: translateY(-2px);
}

.form-control input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* ============================================
   حقل كلمة المرور مع زر الإظهار
   ============================================ */
.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input input {
    padding-left: 50px;
}

.toggle-password {
    position: absolute;
    left: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    padding: 5px;
}

.toggle-password:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* ============================================
   مؤشر قوة كلمة المرور
   ============================================ */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

.password-strength.show {
    opacity: 1;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: var(--error-color);
}

.password-strength-bar.medium {
    width: 66%;
    background: var(--warning-color);
}

.password-strength-bar.strong {
    width: 100%;
    background: var(--success-color);
}

/* ============================================
   خانات الاختيار
   ============================================ */
.checkbox-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.checkbox-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-control label {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    user-select: none;
}

.checkbox-control label a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-control label a:hover {
    text-decoration: underline;
}

/* ============================================
   الأزرار
   ============================================ */
button[type="submit"],
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(157, 132, 199, 0.3);
}

button[type="submit"]:hover,
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(157, 132, 199, 0.4);
}

button[type="submit"]:active,
.btn-primary:active {
    transform: translateY(0);
}

/* ============================================
   الروابط والفواصل
   ============================================ */
.links {
    text-align: center;
    margin-top: 25px;
    color: var(--text-light);
    font-size: 14px;
}

.links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.links p {
    margin: 12px 0;
}

.divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-color);
}

.divider span {
    background: var(--white);
    padding: 0 15px;
    position: relative;
    color: var(--text-light);
    font-size: 13px;
}

/* ============================================
   صفحة الرئيسية (Home)
   ============================================ */
.home-container {
    max-width: 1200px;
    width: 100%;
    z-index: 1;
    position: relative;
}

.header {
    background: var(--white);
    border-radius: 20px;
    padding: 25px 35px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border: 2px solid var(--accent-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(157, 132, 199, 0.4);
    overflow: hidden;
    border: 3px solid var(--white);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details h3 {
    color: var(--text-dark);
    margin-bottom: 5px;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--success-color), #A8D8B9);
    color: #2D5A3D;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.user-details p {
    color: var(--text-light);
    font-size: 14px;
    margin: 3px 0;
}

.logout-btn {
    background: linear-gradient(135deg, var(--error-color), #E89A9A);
    color: #7A3030;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(232, 154, 154, 0.3);
}

.logout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(232, 154, 154, 0.4);
}

.content {
    background: var(--white);
    border-radius: 20px;
    padding: 45px;
    box-shadow: 0 10px 40px var(--shadow);
    border: 2px solid var(--accent-color);
}

.welcome-section {
    text-align: center;
    padding: 40px 0;
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.welcome-section h1 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 32px;
}

.welcome-section p {
    color: var(--text-light);
    font-size: 16px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    padding: 35px;
    border-radius: 18px;
    color: var(--white);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 8px 25px rgba(157, 132, 199, 0.3);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(157, 132, 199, 0.4);
}

.stat-card h3 {
    font-size: 42px;
    margin-bottom: 10px;
    font-weight: 700;
}

.stat-card p {
    font-size: 15px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ============================================
   تصميم متجاوب
   ============================================ */
@media (max-width: 768px) {
    .form-wrapper {
        padding: 30px 25px;
    }
    
    .logo-section h1 {
        font-size: 26px;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .avatar-options {
        flex-direction: row;
    }
    
    .avatar-box i {
        font-size: 36px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
    }
    
    .content {
        padding: 30px 20px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .form-wrapper {
        padding: 25px 20px;
    }
    
    .form-control input {
        font-size: 14px;
        padding: 12px;
    }
    
    button[type="submit"] {
        padding: 14px;
        font-size: 15px;
    }
}

/* ============================================
   تأثيرات إضافية
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* تأثير التحميل */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}