/* ==========================================================================
   AI MEDIA PLATFORM - AUTH STYLES (En/Ar Supported)
   Theme: Creamy White & Premium Gold
   ========================================================================== */

/* SECTION 1: AUTH LAYOUT & BACKGROUND
*/
.auth-container {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: radial-gradient(circle at top right, #fdfbf7, #f3eee7);
    position: relative;
    overflow: hidden;
}

/* Moving Pattern */
.auth-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 30L15 0H30L45 0L30 30Z' fill='%23c28f5f' fill-opacity='0.04'/%3E%3C/svg%3E");
    animation: backgroundScroll 60s linear infinite;
    z-index: 0;
}

@keyframes backgroundScroll {
    from { transform: translate(0, 0); }
    to { transform: translate(-60px, -60px); }
}

/* SECTION 2: AUTH CARD STYLE 
*/
.auth-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(194, 143, 95, 0.2);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 50px rgba(45, 36, 30, 0.08);
    position: relative;
    z-index: 1;
    animation: authFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-logo {
    width: 65px;
    height: 65px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-gold), #d4a373);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 10px 20px rgba(194, 143, 95, 0.25);
}

.auth-title {
    font-size: 1.75rem;
    color: var(--primary-dark);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* SECTION 3: FORM INPUTS & ICONS 
*/
.auth-form .form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-form label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Wrapper for positioning icons */
.input-with-icon, .password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Default LTR Positioning */
.input-with-icon i, .password-input-wrapper .input-icon-left {
    position: absolute;
    left: 15px;
    color: var(--primary-gold);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
    z-index: 2;
}

.auth-form input {
    width: 100%;
    /* LTR Padding: Top Right Bottom Left (Space on Left for Icon) */
    padding: 14px 14px 14px 45px; 
    border: 1.5px solid #eef0f2;
    border-radius: 12px;
    background: #fcfaf8;
    color: var(--primary-dark);
    font-size: 0.95rem;
    transition: var(--transition);
}

.auth-form input:focus {
    background: #fff;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 4px rgba(194, 143, 95, 0.1);
    outline: none;
}

.auth-form input:focus + i, 
.auth-form input:focus ~ .input-icon-left {
    color: var(--primary-dark);
    transform: scale(1.1);
}

/* Password Toggle Eye (LTR) */
.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
    z-index: 3;
}

.password-toggle:hover {
    color: var(--primary-gold);
}

/* SECTION 4: BUTTONS & LINKS 
*/
.auth-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-gold), #a6764a);
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    margin-top: 1rem;
}

.auth-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(194, 143, 95, 0.3);
}

.auth-submit-btn i {
    transition: transform 0.3s ease;
}

.auth-submit-btn:hover i {
    transform: translateX(5px);
}

/* Divider */
.auth-divider {
    margin: 2rem 0;
    display: flex;
    align-items: center;
    text-align: center;
    color: #cbd5e0;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #edf2f7;
}

.auth-divider span {
    padding: 0 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Switch Link */
.auth-switch {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.auth-switch-link {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
    transition: var(--transition);
}

.auth-switch-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* SECTION 5: ERROR HANDLING & ANIMATIONS 
*/
.form-error-text {
    color: #e53e3e;
    font-size: 0.8rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

/* Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }

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

/* SECTION 6: ARABIC RTL SUPPORT (دعم اللغة العربية)
   This block activates automatically when html dir="rtl"
*/

html[dir="rtl"] .auth-container {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .auth-logo {
    /* No flip needed for logo, usually center is fine */
}

/* Flip Icons Position */
html[dir="rtl"] .input-with-icon i, 
html[dir="rtl"] .password-input-wrapper .input-icon-left {
    left: auto;
    right: 15px;
}

/* Flip Input Padding */
html[dir="rtl"] .auth-form input {
    padding: 14px 45px 14px 14px; /* Space on Right for Icon */
}

/* Flip Password Toggle Eye */
html[dir="rtl"] .password-toggle {
    right: auto;
    left: 12px;
}

/* Flip Margins for Links */
html[dir="rtl"] .auth-switch-link {
    margin-left: 0;
    margin-right: 5px;
}

/* Flip Button Arrow Animation */
html[dir="rtl"] .auth-submit-btn i {
    transform: scaleX(-1); /* Flip the arrow icon itself to point left */
}

html[dir="rtl"] .auth-submit-btn:hover i {
    transform: scaleX(-1) translateX(5px); /* Move cleanly */
}

/* SECTION 7: RESPONSIVENESS
*/
@media (max-width: 576px) {
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    .auth-title { font-size: 1.5rem; }
}


/* ==========================================================================
   SECTION 8: LOGIN SPECIFIC STYLES (New Elements)
   ========================================================================== */

/* 1. Form Footer (Container for Remember Me & Forgot Password) */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: -0.5rem; /* Pull closer to password field */
}

/* 2. Custom Checkbox Design (The Magic Part) */
.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    user-select: none; /* Prevent text selection on click */
    transition: var(--transition);
}

.remember-me:hover {
    color: var(--primary-dark);
}

/* Hide the default ugly browser checkbox */
.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create the custom box */
.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 6px; /* Soft square */
    margin-right: 10px; /* Space for LTR */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effect on the box */
.remember-me:hover input ~ .checkmark {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(194, 143, 95, 0.1);
}

/* When Checked: Background becomes Gold */
.remember-me input:checked ~ .checkmark {
    background-color: var(--primary-gold);
    border-color: var(--primary-gold);
    transform: scale(1.05);
}

/* Create the Check mark icon (L Shape) */
.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 6.5px;
    top: 2.5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0; /* Only right and bottom border */
    transform: rotate(45deg);
}

/* Show the check mark when checked */
.remember-me input:checked ~ .checkmark::after {
    display: block;
}

/* 3. Forgot Password Link */
.forgot-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-gold);
}

/* Tiny underline animation for the link */
.forgot-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1.5px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-gold);
    transition: width 0.3s ease;
}

.forgot-link:hover::after {
    width: 100%;
}

/* ==========================================================================
   SECTION 9: LOGIN RTL SUPPORT (Arabic Updates)
   Add this INSIDE existing RTL block or separate
   ========================================================================== */

/* Flip spacing for Custom Checkbox in Arabic */
html[dir="rtl"] .checkmark {
    margin-right: 0;
    margin-left: 10px;
}

/* Ensure the check mark inside looks correct (Optional refinement) */
html[dir="rtl"] .checkmark::after {
    left: 6.5px; /* Position remains relative to the box, so usually fine */
}

/* Adjust the underline animation direction */
html[dir="rtl"] .forgot-link::after {
    left: auto;
    right: 0;
}

/* Responsive Fix for very small screens */
@media (max-width: 400px) {
    .form-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    html[dir="rtl"] .form-footer {
        align-items: flex-start; /* Or flex-end depending on design preference */
    }
}


/* ==========================================================================
   SECTION 10: VERIFICATION PAGE (OTP) - Premium Refinement
   ========================================================================== */

/* 1. Wrapper for OTP Inputs */
.verification-input-wrapper {
    display: flex;
    justify-content: center;
    gap: 8px; /* تقليل المسافة في الموبايل */
    margin: 2rem 0;
    direction: ltr;
    flex-wrap: nowrap; /* منع النزول لسطر جديد */
}

/* 2. Individual Digit Input Styles */
.verification-digit {
    width: 14%; /* جعل العرض نسبة مئوية ليناسب كل الشاشات */
    max-width: 50px;
    aspect-ratio: 1 / 1.2; /* يحافظ على التناسب مهما كان العرض */
    height: auto;
    border: 2px solid #eef0f2;
    border-radius: 12px;
    background: #fcfaf8;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
    transition: all 0.2s ease;
}

.verification-digit:focus {
    border-color: var(--primary-gold);
    background: #fff;
    transform: translateY(-5px); /* حركة ذكية للأعلى عند الكتابة */
    box-shadow: 0 10px 20px rgba(194, 143, 95, 0.15);
    outline: none;
}

/* 3. Resend Section Styling */
.resend-section {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #edf2f7;
}

.resend-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.btn-resend {
    background: none;
    border: none;
    color: var(--primary-gold);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-resend:hover {
    color: var(--primary-dark);
}

.btn-resend i {
    font-size: 0.85rem;
    transition: transform 0.5s ease;
}

.btn-resend:hover i {
    transform: rotate(180deg); /* دوران الأيقونة عند التمرير */
}

.timer {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #e53e3e; /* لون أحمر هادئ للعد التنازلي */
    font-weight: 600;
}

/* 4. Verification RTL Specifics */
html[dir="rtl"] .verification-input-wrapper {
    /* نتركها LTR لأن الأرقام والرموز عالمياً تُكتب هكذا */
    flex-direction: row; 
}

/* ==========================================================================
   SECTION 11: TEXT GOLD UTILITY
   ========================================================================== */
.text-gold {
    color: var(--primary-gold);
    font-weight: 700;
}

@media (max-width: 480px) {
    .verification-digit {
        font-size: 1.2rem;
        border-width: 1.5px;
    }
    .verification-digit:focus {
        transform: translateY(-3px);
    }
}

/* ==========================================================================
   SECTION 12: PROFILE PAGE - THE ROYAL EXPERIENCE 👑
   ========================================================================== */

.profile-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 1. Header Card (The Masterpiece) */
.profile-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(194, 143, 95, 0.15);
    border-radius: 30px; /* زوايا فائقة النعومة */
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(45, 36, 30, 0.05);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

/* إضافة لمسة ذهبية خفيفة في الزاوية */
.profile-header::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(194, 143, 95, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
}

/* 2. Avatar Styling (The Golden Stroke) */
.profile-avatar-container {
    position: relative;
    z-index: 2;
}

.profile-avatar-large, .profile-avatar-large-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    outline: 2px solid var(--primary-gold); /* الإطار الذهبي الخارجي */
    transition: var(--transition);
}

.profile-avatar-large-placeholder {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 800;
}

.profile-avatar-container:hover .profile-avatar-large {
    transform: scale(1.03) rotate(2deg);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary-dark);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #fff;
    transition: var(--transition);
}

.profile-avatar-edit:hover {
    background: var(--primary-gold);
    transform: scale(1.1);
}

/* 3. Text & Details */
.profile-details { flex: 1; min-width: 300px; }

.profile-name {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
    letter-spacing: -1px;
}

.profile-username {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.dxn-badge {
    background: rgba(194, 143, 95, 0.1);
    color: var(--primary-gold);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    border: 1px solid rgba(194, 143, 95, 0.2);
}

.profile-bio {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

/* 4. Meta Grid (Stats) */
.profile-meta-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;
}

.meta-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fdfaf8;
    padding: 10px 18px;
    border-radius: 15px;
    border: 1px solid rgba(194, 143, 95, 0.05);
    transition: var(--transition);
}

.meta-box:hover {
    background: #fff;
    border-color: var(--primary-gold);
    transform: translateY(-3px);
}

.meta-box i { color: var(--primary-gold); font-size: 1.2rem; }
.meta-label { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.meta-value { font-weight: 700; color: var(--primary-dark); font-size: 0.95rem; }

/* 5. Action Buttons (Premium) */
/* تنسيق زر Mon Agent IA المطور */
.profile-actions-wrapper .btn-outline {
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.profile-actions-wrapper .btn-outline:hover {
    background: var(--primary-gold);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(194, 143, 95, 0.2);
}

/* تنسيق زر Remove Friend (الأحمر الهادئ) */
.btn-remove {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #feb2b2;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove:hover {
    background: #e53e3e;
    color: white;
    transform: scale(1.05);
}

/* تنسيق زر Demande Envoyée (الحالة المنتظرة) */
.btn-status {
    background: #f8f9fa;
    color: #adb5bd;
    border: 1px solid #e9ecef;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    gap: 8px;
}




.btn-premium {
    background: linear-gradient(135deg, var(--primary-dark), #4a3f35);
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-premium:hover {
    background: var(--primary-gold);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(194, 143, 95, 0.2);
}

.btn-chat {
    background: var(--primary-gold);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.badge-friends {
    background: #f0fdf4;
    color: #166534;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    border: 1px solid #bbf7d0;
}

/* 6. Activities Section */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--primary-dark);
}

.section-title i { color: var(--primary-gold); }

/* Empty State */
.empty-feed-card {
    text-align: center;
    padding: 5rem;
    background: #fff;
    border-radius: 30px;
    border: 2px dashed #eee;
}

.empty-img { width: 120px; opacity: 0.5; margin-bottom: 1.5rem; }

/* ==========================================================================
   RTL SUPPORT FOR PROFILE
   ========================================================================== */
html[dir="rtl"] .profile-header::after { right: auto; left: -50px; }
html[dir="rtl"] .profile-avatar-edit { right: auto; left: 10px; }
html[dir="rtl"] .meta-box i { margin-left: 5px; }

/* Animation Keyframes */
@keyframes profileFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .profile-info { flex-direction: column; text-align: center; gap: 1.5rem; }
    .profile-meta-grid { justify-content: center; flex-wrap: wrap; }
    .profile-actions-wrapper { justify-content: center; }
}



/* ==========================================================================
   SECTION 13: EDIT PROFILE - THE PREMIUM SETTINGS ⚙️
   ========================================================================== */

/* 1. Container & Main Card */
.premium-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 28px;
    border: 1px solid rgba(194, 143, 95, 0.15);
    padding: 3rem;
    box-shadow: 0 30px 60px rgba(45, 36, 30, 0.05);
}

.card-header-centered {
    text-align: center;
    margin-bottom: 3rem;
}

.header-icon {
    width: 60px;
    height: 60px;
    background: rgba(194, 143, 95, 0.1);
    color: var(--primary-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    border: 1px solid rgba(194, 143, 95, 0.2);
}

.card-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 2. Modern Form Grid */
.modern-form .form-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* تقسيم غير متساوي للفخامة */
    gap: 3rem;
    margin-bottom: 2rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label i {
    color: var(--primary-gold);
    font-size: 1.1rem;
}

/* Inputs & Selects Tuning */
.modern-form input[type="text"],
.modern-form select,
.modern-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #eef0f2;
    border-radius: 12px;
    background: #fdfaf8;
    transition: var(--transition);
    color: var(--primary-dark);
    font-size: 1rem;
}

.modern-form input:focus, 
.modern-form select:focus, 
.modern-form textarea:focus {
    border-color: var(--primary-gold);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(194, 143, 95, 0.1);
    outline: none;
}

/* 3. Avatar Upload Section (The Visual Hero) */
.avatar-upload-section {
    background: #fdfaf8;
    padding: 2rem;
    border-radius: 20px;
    border: 1px dashed rgba(194, 143, 95, 0.3);
    text-align: center;
}

.avatar-preview-wrapper {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.edit-avatar-img, .edit-avatar-placeholder {
    width: 130px;
    height: 130px;
    border-radius: 24px; /* زوايا مربعة ناعمة بدلاً من الدائرة الكاملة للتجديد */
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow);
}

.edit-avatar-placeholder {
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
}

.btn-upload {
    background: var(--primary-dark);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-upload:hover {
    background: var(--primary-gold);
    transform: translateY(-2px);
}

/* Hide the real file input */
input[type="file"] { display: none; }

/* 4. Bio Area & Counter */
.full-width { grid-column: 1 / -1; }

.modern-form textarea {
    height: 120px;
    resize: none;
}

.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 600;
}

/* 5. Action Buttons (Bottom Bar) */
.form-actions-premium {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #edf2f7;
}

.btn-save {
    background: linear-gradient(135deg, var(--primary-gold), #a6764a);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(194, 143, 95, 0.3);
}

.btn-cancel {
    background: #fff;
    color: var(--text-muted);
    border: 1.5px solid #eef0f2;
    padding: 14px 25px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-cancel:hover {
    background: #fdfaf8;
    color: #e53e3e;
    border-color: #feb2b2;
}

/* ==========================================================================
   RTL SUPPORT FOR EDIT PROFILE
   ========================================================================== */
html[dir="rtl"] .char-counter { text-align: left; }
html[dir="rtl"] .form-actions-premium { justify-content: flex-start; flex-direction: row-reverse; }
html[dir="rtl"] .form-group label i { margin-left: 0; margin-right: 0; }

/* Responsive Adjustments */
@media (max-width: 850px) {
    .modern-form .form-grid { grid-template-columns: 1fr; gap: 2rem; }
    .avatar-upload-section { order: -1; } /* وضع الصورة في الأعلى في الموبايل */
    .premium-card { padding: 1.5rem; }
}



/* ==========================================================================
   SECTION 14: FRIENDS LIST & NETWORK - THE SOCIAL HUB 🤝
   ========================================================================== */

.friends-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.friends-page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.friends-page-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.friends-page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* 1. Premium Tabs System */
.premium-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2.5rem;
    background: rgba(194, 143, 95, 0.05);
    padding: 8px;
    border-radius: 20px;
    border: 1px solid rgba(194, 143, 95, 0.1);
}

.tab-link {
    padding: 12px 25px;
    border: none;
    background: none;
    border-radius: 15px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-link.active {
    background: white;
    color: var(--primary-gold);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.tab-link .badge, .tab-link .badge-notify {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 8px;
}

.tab-link .badge { background: #eee; color: #666; }
.tab-link .badge-notify { background: var(--primary-gold); color: white; animation: pulse 2s infinite; }

/* 2. Search Box */
.search-filter-wrapper { margin-bottom: 2rem; }

.modern-search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.modern-search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-gold);
}

.modern-search-box input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border-radius: 15px;
    border: 1.5px solid #eef0f2;
    background: white;
    font-weight: 500;
}

/* 3. Friends Grid & Cards */
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.friend-card {
    background: white;
    border-radius: 22px;
    border: 1px solid rgba(194, 143, 95, 0.1);
    padding: 20px;
    transition: var(--transition);
    overflow: hidden;
}

.friend-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-gold);
    box-shadow: 0 15px 35px rgba(194, 143, 95, 0.12);
}

.friend-card-body {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.avatar-box {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    overflow: hidden;
    background: #fdfaf8;
    border: 2px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.avatar-img { width: 100%; height: 100%; object-fit: cover; }

.avatar-text {
    width: 100%; height: 100%; 
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-dark));
    color: white; font-weight: 800; font-size: 1.5rem;
}

.friend-meta .name { font-size: 1.1rem; font-weight: 800; color: var(--primary-dark); margin: 0; }
.friend-meta .user-id { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

/* 4. Action Buttons Footer */
.friend-card-footer {
    display: flex;
    gap: 10px;
    border-top: 1px solid #f8f9fa;
    padding-top: 15px;
}

.action-btn {
    flex: 1;
    height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; border: none; cursor: pointer;
    transition: var(--transition);
}

.action-btn.chat { background: rgba(194, 143, 95, 0.1); color: var(--primary-gold); }
.action-btn.profile { background: #f8f9fa; color: var(--primary-dark); }
.action-btn.remove { background: #fff5f5; color: #e53e3e; }

.action-btn:hover { transform: translateY(-2px); filter: brightness(0.95); }

/* 5. Request Items */
.requests-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

.request-item {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #f0f0f0;
}

.user-info { display: flex; align-items: center; gap: 12px; }
.avatar-sm { width: 45px; height: 45px; border-radius: 12px; object-fit: cover; }

.request-btns { display: flex; gap: 8px; }
.btn-accept, .btn-reject {
    width: 38px; height: 38px; border-radius: 10px; border: none; cursor: pointer; transition: 0.3s;
}
.btn-accept { background: #f0fdf4; color: #16a34a; }
.btn-reject { background: #fff1f2; color: #e11d48; }
.btn-accept:hover { background: #16a34a; color: white; }

/* 6. Empty States */
.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; color: #eee; margin-bottom: 1rem; }

/* Tab Panes Visibility */
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeInUp 0.4s ease; }

/* RTL Support */
html[dir="rtl"] .modern-search-box i { left: auto; right: 18px; }
html[dir="rtl"] .modern-search-box input { padding: 15px 50px 15px 15px; }
html[dir="rtl"] .tab-link i { margin-left: 0; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   SECTION 15: SUBSCRIPTION & PAYMENTS - THE GOLDEN GATE 💳
   ========================================================================== */

/* 1. The Membership Card (Hero Element) */
.subscription-card-modern {
    position: relative;
    border-radius: 24px;
    padding: 2.5rem;
    color: white;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: 0 25px 50px rgba(194, 143, 95, 0.25);
    transition: var(--transition);
}

/* خلفية البطاقة النشطة (ذهبي فاخر) */
.active-theme {
    background: linear-gradient(135deg, #d4af37 0%, #c5a028 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* خلفية البطاقة المنتهية (رمادي/أحمر داكن) */
.expired-theme {
    background: linear-gradient(135deg, #4a4a4a, #2d2d2d);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* نقشة خلفية خفيفة للبطاقة */
.sub-card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    pointer-events: none;
}

.sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.sub-type {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sub-type i { font-size: 1.6rem; }

/* مؤشرات الحالة (النبض) */
.status-indicator {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.pulse-green, .pulse-red {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.pulse-green { background: #4ade80; box-shadow: 0 0 0 rgba(74, 222, 128, 0.7); animation: pulse-green 2s infinite; }
.pulse-red { background: #f87171; box-shadow: 0 0 0 rgba(248, 113, 113, 0.7); animation: pulse-red 2s infinite; }

.sub-stats {
    display: flex;
    gap: 3rem;
    position: relative;
    z-index: 2;
}

.stat-item label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stat-item span {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace; /* لتبدو مثل أرقام الفيزا */
    letter-spacing: 1px;
}

/* رسالة الدخول المجاني */
.free-access-msg {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 1rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

/* 2. Payment Grid Layout */
.payment-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr; /* منطقة الدفع أكبر قليلاً من التاريخ */
    gap: 2rem;
}

/* 3. Payment Box (The Form) */
.payment-box, .history-box {
    background: #fff;
    border-radius: 22px;
    padding: 2rem;
    border: 1px solid #f0f0f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    height: 100%;
}

.payment-box h3, .history-box h3 {
    font-size: 1.2rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-box h3 i { color: var(--primary-gold); }
.text-muted { color: #9ca3af; font-size: 0.9rem; margin-bottom: 1.5rem; }

/* Airtel Selection Button */
.method-selector { margin-bottom: 1.5rem; }

.method-btn {
    border: 2px solid var(--primary-gold);
    background: #fffcf5;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: default;
    position: relative;
}

/* وضع علامة الصح الصغيرة */
.method-btn::after {
    content: '\f00c';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: -10px; right: -10px;
    background: var(--primary-gold);
    color: white;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    border: 2px solid white;
}

.method-btn img { height: 35px; object-fit: contain; }
.method-btn span { font-weight: 700; color: #e60000; /* Airtel Red */ }

/* Phone Input Styling */
.input-wrapper {
    display: flex;
    border: 1.5px solid #eef0f2;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 4px rgba(194, 143, 95, 0.1);
}

.prefix {
    background: #f8f9fa;
    padding: 14px 15px;
    font-weight: 600;
    color: var(--text-muted);
    border-right: 1px solid #eef0f2;
    direction: ltr;
}

#phone_number {
    border: none;
    flex: 1;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    outline: none;
}

/* Total Bar */
.total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fdfaf8;
    border-radius: 10px;
    border: 1px dashed rgba(194, 143, 95, 0.3);
}

.total-bar span { color: var(--text-muted); font-size: 0.9rem; }
.total-bar strong { font-size: 1.2rem; color: var(--primary-dark); }

/* The Payment Button (Golden Shimmer) */
.btn-pay-gold {
    width: 100%;
    background: linear-gradient(45deg, var(--primary-gold), #b88655, var(--primary-gold));
    background-size: 200% auto;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.5s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

.btn-pay-gold:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(194, 143, 95, 0.3);
}

/* 4. History Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 2px solid #f0f0f0;
}

td {
    padding: 15px 10px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f9f9f9;
    font-weight: 500;
}

/* Status Dots in Table */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.completed { background: #4ade80; } /* Green */
.status-dot.pending { background: #facc15; } /* Yellow */
.status-dot.failed { background: #f87171; } /* Red */

.empty-msg {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

/* RTL Support */
html[dir="rtl"] .sub-stats { text-align: right; }
html[dir="rtl"] .method-btn { padding-right: 12px; padding-left: 0; }
html[dir="rtl"] .method-btn::after { right: auto; left: -10px; }
html[dir="rtl"] .prefix { border-right: none; border-left: 1px solid #eef0f2; }
html[dir="rtl"] th { text-align: right; }
html[dir="rtl"] .status-dot { margin-right: 0; margin-left: 6px; }

/* Animations */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(248, 113, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .payment-grid { grid-template-columns: 1fr; }
    .sub-stats { flex-direction: column; gap: 1rem; }
    .subscription-card-modern { padding: 1.5rem; }
}
