/* ============================================================
   وصال – الهوية البصرية (النسخة النهائية v4.0.4)
   تم التعديل: تكبير الصور في البحث، إضافة بطاقة الكود الخضراء
   ============================================================ */

:root {
    --primary: #d63384;
    --primary-dark: #b02a6e;
    --primary-light: #f06292;
    --primary-glow: rgba(214, 51, 132, 0.15);
    --bg-main: #fef6f2;
    --bg-card: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #6c5a7a;
    --text-light: #b5b0a8;
    --border: #fce4ec;
    --shadow-sm: 0 8px 24px rgba(214, 51, 132, 0.06);
    --shadow-md: 0 12px 36px rgba(214, 51, 132, 0.10);
    --shadow-lg: 0 20px 48px rgba(214, 51, 132, 0.14);
    --shadow-hover: 0 16px 48px rgba(214, 51, 132, 0.18);
    --radius-card: 28px;
    --radius-btn: 50px;
    --radius-input: 18px;
    --online-color: #2ecc71;
    --offline-color: #b5b0a8;
    --gradient-primary: linear-gradient(135deg, #d63384, #f06292);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gm-color: #22c55e;
    --gm-color-dark: #16a34a;
    --gm-glow: rgba(34, 197, 94, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    padding-bottom: 80px;
    min-height: 100vh;
}

/* ===== شريط الأخبار ===== */
.news-ticker {
    background: var(--gradient-primary);
    color: #ffffff;
    padding: 10px 16px;
    height: 44px;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1050;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(214, 51, 132, 0.15);
}

.news-ticker span {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    animation: scrollText 30s linear infinite;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    letter-spacing: 0.3px;
}

@keyframes scrollText {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== الهيدر العلوي ===== */
.main-header {
    background: #ffffff;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 44px;
    width: 100%;
    z-index: 1040;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo span {
    color: var(--primary);
}

.save-app-btn {
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    padding: 6px 18px;
    border-radius: var(--radius-btn);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(214, 51, 132, 0.2);
}

.save-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 51, 132, 0.3);
}

.notification-icon {
    font-size: 22px;
    position: relative;
    cursor: pointer;
    color: var(--text-dark);
    transition: var(--transition-smooth);
}

.notification-icon:hover {
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    display: none;
    min-width: 20px;
    text-align: center;
}

/* ===== الصفحات ===== */
.page {
    display: none;
    margin-top: 110px;
    padding: 16px;
    padding-bottom: 30px;
    animation: fadeIn 0.4s ease;
}

.page.active-page {
    display: block;
}

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

/* ===== التنقل السفلي ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    z-index: 1050;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    contain: layout style;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: auto;
}

.nav-item {
    text-align: center;
    font-size: 11px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 6px;
    border-radius: 20px;
    user-select: none;
    flex: 1;
    max-width: 80px;
    background: transparent;
    border: none;
    font-family: inherit;
    position: relative;
}

.nav-item .nav-icon {
    font-size: 26px;
    display: block;
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.nav-item .nav-label {
    font-size: 11px;
    font-weight: 400;
}

.nav-item.active .nav-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.nav-item.active .nav-label {
    color: var(--primary);
    font-weight: 700;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.nav-item:hover:not(.active) .nav-icon {
    color: var(--primary-light);
}

.nav-item:hover:not(.active) .nav-label {
    color: var(--primary-light);
}

.nav-item.disabled {
    color: #d1d5db !important;
    pointer-events: none;
    opacity: 0.5;
}

.keyboard-open .bottom-nav {
    display: none !important;
}

/* ===== القوائم المنسدلة ===== */
.dropdown-container {
    position: relative;
    width: 100%;
}

.dropdown-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 15px;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
    user-select: none;
}

.dropdown-input:hover {
    background: #f8f0ec;
}

.dropdown-input.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #ffffff;
}

.dropdown-input .arrow {
    transition: var(--transition-smooth);
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 8px;
}

.dropdown-input .arrow.open {
    transform: rotate(180deg);
    color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    padding: 0;
}

.dropdown-menu.open {
    max-height: 240px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    padding: 6px 0;
}

.dropdown-menu::-webkit-scrollbar {
    width: 4px;
}
.dropdown-menu::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 10px;
}
.dropdown-menu::-webkit-scrollbar-thumb {
    background: #d5d0c8;
    border-radius: 10px;
}

.dropdown-item {
    padding: 12px 18px;
    font-size: 15px;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition-smooth);
    border-radius: 12px;
    margin: 2px 6px;
}

.dropdown-item:hover {
    background: var(--primary-glow);
    transform: translateX(4px);
}

.dropdown-item.selected {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
}

/* ===== لقب GM باللون الأخضر ===== */
.gm-tag {
    color: var(--gm-color);
    font-weight: 700;
    font-size: 14px;
    margin-right: 4px;
}

/* ===== بطاقة الكود الخضراء ===== */
.member-code-badge {
    display: inline-block;
    background: var(--gm-color);
    color: #ffffff;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
    letter-spacing: 0.3px;
    vertical-align: middle;
}

/* ===== النوافذ المنبثقة العامة ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    z-index: 99997;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: modalFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-card);
    padding: 30px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    color: var(--text-dark);
    font-size: 22px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: var(--text-dark);
    transform: rotate(90deg);
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.modal-body .form-group input,
.modal-body .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 15px;
    background: var(--bg-main);
    font-family: inherit;
    transition: var(--transition-smooth);
    color: var(--text-dark);
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #ffffff;
}

/* ===== نافذة تفعيل الاتصال ===== */
#callActivationModal .modal-content {
    max-width: 420px;
    text-align: center;
    padding: 30px 24px;
}

#callActivationModal .modal-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

#callActivationModal .modal-content p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.6;
}

#callActivationModal .btn-activate {
    background: #22c55e;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
    min-width: 120px;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

#callActivationModal .btn-activate:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 24px rgba(34, 197, 94, 0.4);
}

#callActivationModal .btn-decline {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
    min-width: 120px;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

#callActivationModal .btn-decline:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.4);
}

/* ===== نافذة التحويل إلى GM ===== */
#redirectToGMModal .modal-content {
    max-width: 400px;
    text-align: center;
    padding: 30px 24px;
}

#redirectToGMModal .modal-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

#redirectToGMModal .modal-content p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
}

#redirectToGMModal .progress-container {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

#redirectToGMModal .progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#redirectToGMModal .progress-text {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* ===== نافذة إدارة الردود (لـ LM) ===== */
#lmAutoReplyModal .modal-content {
    max-width: 550px;
}

#lmAutoReplyModal .auto-reply-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-main);
    border-radius: 16px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
}

#lmAutoReplyModal .auto-reply-item:hover {
    background: #f8f0ec;
}

#lmAutoReplyModal .auto-reply-item .reply-info {
    flex: 1;
    font-size: 14px;
    min-width: 0;
}

#lmAutoReplyModal .auto-reply-item .reply-info .reply-text {
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-word;
}

#lmAutoReplyModal .auto-reply-item .reply-info .reply-detail {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

#lmAutoReplyModal .auto-reply-item .reply-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

#lmAutoReplyModal .auto-reply-item .reply-actions button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

#lmAutoReplyModal .auto-reply-item .reply-actions .edit-btn:hover {
    background: rgba(214, 51, 132, 0.1);
    color: var(--primary);
}

#lmAutoReplyModal .auto-reply-item .reply-actions .delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

#lmAutoReplyModal .info-box {
    padding: 12px;
    background: var(--bg-main);
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

#lmAutoReplyModal .info-box p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== نافذة إدارة الردود (للأدمن) ===== */
#adminAutoReplyModal .modal-content {
    max-width: 550px;
}

#adminAutoReplyUserInfo {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--bg-main);
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#adminAutoReplyUserInfo .user-name {
    font-weight: 600;
    color: var(--text-dark);
}

#adminAutoReplyUserInfo .user-code {
    color: var(--text-muted);
    font-size: 14px;
}

#adminAutoRepliesList {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.admin-reply-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-main);
    border-radius: 16px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
}

.admin-reply-item:hover {
    background: #f8f0ec;
}

.admin-reply-item .reply-info {
    flex: 1;
    font-size: 14px;
    min-width: 0;
}

.admin-reply-item .reply-info .reply-text {
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-word;
}

.admin-reply-item .reply-info .reply-detail {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.admin-reply-item .reply-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.admin-reply-item .reply-actions button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.admin-reply-item .reply-actions .edit-btn:hover {
    background: rgba(214, 51, 132, 0.1);
    color: var(--primary);
}

.admin-reply-item .reply-actions .delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ===== حقل الرد المتكيف ===== */
#adminNewReplyText,
#newReplyText {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-main);
    transition: var(--transition-smooth);
    resize: vertical;
    min-height: 50px;
    max-height: 200px;
    line-height: 1.5;
}

#adminNewReplyText:focus,
#newReplyText:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #ffffff;
}

/* ===== زر "ردود" في قائمة الأعضاء (لوحة الأدمن) ===== */
.admin-reply-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.admin-reply-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===== تحسين عرض قائمة الأعضاء ===== */
#adminUsersList .admin-list-item .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* ===== باقي الأنماط ===== */
.search-card, .form-container, .profile-card, .admin-panel, .about-content {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.search-card::before, .form-container::before, .profile-card::before, .admin-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.search-card:hover, .form-container:hover, .profile-card:hover, .admin-panel:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.filter-group {
    margin-bottom: 18px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.gender-options {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.gender-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.gender-options label:hover {
    color: var(--text-dark);
}

.gender-options input[type="radio"] {
    accent-color: var(--primary);
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.age-range {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.age-range .age-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.age-range .age-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0;
}

.age-range .age-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 14px;
    background: var(--bg-main);
    transition: var(--transition-smooth);
}

.age-range .age-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

select, input, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 15px;
    background: var(--bg-main);
    font-family: inherit;
    transition: var(--transition-smooth);
    color: var(--text-dark);
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 70px;
}

.service-price-display {
    margin-top: 8px;
    padding: 10px 16px;
    background: var(--gradient-primary);
    color: #fff;
    border-radius: var(--radius-input);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(214, 51, 132, 0.2);
}

.service-price-display.show {
    opacity: 1;
    transform: translateY(0);
}

.search-btn, .new-request-btn {
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-btn);
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(214, 51, 132, 0.2);
    position: relative;
    overflow: hidden;
}

.search-btn::after, .new-request-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
}

.search-btn:hover::after, .new-request-btn:hover::after {
    opacity: 1;
}

.search-btn:hover, .new-request-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(214, 51, 132, 0.3);
}

.search-btn:active, .new-request-btn:active {
    transform: scale(0.98);
}

.form-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.form-nav-btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex: 1;
}

.form-nav-btn.next {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(214, 51, 132, 0.2);
}

.form-nav-btn.next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(214, 51, 132, 0.3);
}

.form-nav-btn.prev {
    background: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.form-nav-btn.prev:hover {
    background: #f8f0ec;
    border-color: var(--primary);
    color: var(--text-dark);
}

.submit-form-btn {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 18px rgba(214, 51, 132, 0.25);
}

.submit-form-btn:hover {
    transform: scale(1.01);
    box-shadow: 0 6px 28px rgba(214, 51, 132, 0.35);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-avatar {
    width: 110px;
    height: 110px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    margin: 0 auto 16px;
    position: relative;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    overflow: hidden;
    border: 3px solid var(--primary);
    transition: var(--transition-smooth);
}

.profile-avatar:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

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

.online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: var(--online-color);
}

.online-dot.offline {
    background: var(--offline-color);
}

.edit-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 10px 28px;
    border-radius: var(--radius-btn);
    margin-top: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.edit-btn:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(214, 51, 132, 0.2);
}

.about-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius-btn);
    margin-top: 16px;
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    color: var(--text-muted);
}

.about-btn:hover {
    background: var(--bg-main);
    border-color: var(--primary);
    color: var(--text-dark);
}

.matchmaker-fab {
    position: fixed;
    bottom: 95px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    z-index: 1020;
    background: none;
    border: none;
    padding: 0;
}

.matchmaker-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-smooth);
}

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

.matchmaker-fab:hover .matchmaker-avatar {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.matchmaker-fab .matchmaker-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ===== المحادثات ===== */
.chat-list {
    background: #ffffff;
    border-radius: var(--radius-card);
    padding: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius-input);
    transition: var(--transition-smooth);
}

.chat-item:hover {
    background: var(--bg-main);
}

.chat-item .avatar {
    width: 50px;
    height: 50px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border);
}

.chat-preview {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 700;
    color: var(--text-dark);
}

.chat-last {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#chatPage {
    margin-top: 0;
    padding: 0;
    height: 100vh;
    background: var(--bg-main);
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 3000;
}

#chatPage.active-page {
    display: flex;
}

#chatHeader {
    flex-shrink: 0;
    z-index: 10;
}

#chatMessagesContainer {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fef6f2;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

#chatInputArea {
    background: white;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    transition: transform 0.25s ease;
}

/* ===== أزرار الاتصال داخل حقل الكتابة ===== */
.call-btn-input {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.call-btn-input:hover {
    background: var(--primary-glow);
    color: var(--primary);
    transform: scale(1.1);
}

.call-btn-input:active {
    transform: scale(0.9);
}

/* ===== رسائل المحادثة ===== */
.message-bubble {
    max-width: 78%;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
    position: relative;
    animation: messageIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.message-bubble .message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    display: block;
    text-align: left;
    direction: ltr;
}

.message-bubble.other .message-time {
    color: var(--text-muted);
}

.message-bubble.me {
    background: var(--gradient-primary);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.message-bubble.other {
    background: #ffffff;
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border);
}

.message-bubble.other .message-time {
    color: var(--text-muted);
}

/* ===== أزرار الاتصال القديمة (لم تعد مستخدمة، ولكن نحتفظ بها للتوافق) ===== */
.call-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #faf5ef !important;
    padding: 6px 14px !important;
    border-radius: 30px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    align-items: center !important;
    gap: 6px !important;
    transition: 0.3s !important;
    display: inline-flex !important;
}

.call-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.05);
}

/* ===== شاشة المكالمة الواردة ===== */
#incomingCallScreen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 99998;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    animation: modalFadeIn 0.4s ease;
}

#incomingCallScreen .caller-avatar {
    width: 100px;
    height: 100px;
    background: #faf5ef;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    overflow: hidden;
    border: 3px solid var(--primary);
}

#incomingCallScreen .caller-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

#incomingCallScreen .call-type-text {
    color: #fce4ec;
    font-size: 16px;
    margin-bottom: 30px;
}

#incomingCallScreen .call-actions {
    display: flex;
    gap: 40px;
    justify-content: center;
}

#incomingCallScreen .call-actions button {
    border: none;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    font-size: 30px;
    color: white;
    cursor: pointer;
    transition: var(--transition-smooth);
}

#incomingCallScreen .call-actions .accept-btn {
    background: #27ae60;
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4);
}

#incomingCallScreen .call-actions .accept-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(39, 174, 96, 0.5);
}

#incomingCallScreen .call-actions .reject-btn {
    background: #e74c3c;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
}

#incomingCallScreen .call-actions .reject-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(231, 76, 60, 0.5);
}

/* ===== بطاقات الأعضاء (معدلة: صورة 90px + بطاقة كود خضراء) ===== */
.member-card {
    background: #ffffff;
    border-radius: var(--radius-card);
    padding: 16px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.member-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-smooth);
}

.member-card:hover::before {
    opacity: 0.6;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border);
}

.member-card .avatar {
    width: 90px; /* تم التغيير من 64px إلى 90px */
    height: 90px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: var(--transition-smooth);
}

.member-card .avatar:hover {
    transform: scale(1.02);
}

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

.member-card .online-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: var(--online-color);
}

.member-card .online-dot.offline {
    background: var(--offline-color);
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.member-code {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-right: 6px;
}

.member-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.action-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-like,
.btn-message {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-like {
    color: #d1d5db;
}

.btn-like.liked {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}

.btn-message {
    color: var(--primary);
    background: rgba(214, 51, 132, 0.06);
}

.btn-message:hover {
    background: rgba(214, 51, 132, 0.15);
    transform: scale(1.1);
}

.no-results {
    text-align: center;
    padding: 48px 20px;
    background: #ffffff;
    border-radius: var(--radius-card);
    color: var(--text-muted);
    font-size: 16px;
    border: 1px dashed var(--border);
}

/* ===== نوافذ تسجيل الدخول ===== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: #ffffff;
    border-radius: var(--radius-card);
    padding: 32px 28px;
    width: 92%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-height: 92vh;
    overflow-y: auto;
}

.auth-card h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 700;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 15px;
    background: var(--bg-main);
    font-family: inherit;
}

.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #ffffff;
}

.auth-card button {
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: var(--radius-btn);
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(214, 51, 132, 0.15);
}

.auth-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(214, 51, 132, 0.25);
}

/* ===== شاشة تحميل مصغرة ===== */
#authLoadingOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99998;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#authLoadingOverlay > div {
    background: white;
    border-radius: 28px;
    padding: 30px 40px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#authLoadingOverlay h3 {
    color: var(--text-dark);
    font-size: 18px;
    margin-bottom: 16px;
}

#authLoadingOverlay .progress-container {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

#authLoadingOverlay .progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#authLoadingOverlay .progress-text {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 10px;
}

/* ===== لوحة الأدمن ===== */
.admin-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-main);
    padding: 16px 20px;
    border-radius: var(--radius-input);
    flex: 1;
    text-align: center;
    border: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-dark);
    min-width: 80px;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.admin-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-main);
    border-radius: var(--radius-input);
    margin-bottom: 8px;
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
}

.admin-list-item:hover {
    background: #f8f0ec;
}

.admin-list-item .info {
    flex: 1;
    font-size: 14px;
}

.admin-list-item .info .name {
    font-weight: 700;
    color: var(--text-dark);
}

.admin-list-item .info .detail {
    color: var(--text-muted);
    font-size: 13px;
}

.admin-list-item .actions {
    display: flex;
    gap: 8px;
}

.admin-list-item .actions button {
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

/* ===== التجاوب ===== */
@media (max-width: 520px) {
    .bottom-nav {
        padding: 6px 0 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    .nav-item {
        max-width: 64px;
    }
    .nav-item .nav-icon {
        font-size: 22px;
    }
    .nav-item.active .nav-icon {
        font-size: 26px;
    }
    .nav-item .nav-label {
        font-size: 10px;
    }
    .nav-item.active .nav-label {
        font-size: 11px;
    }
    .gender-options {
        gap: 14px;
    }
    .member-card {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    .member-card .avatar {
        width: 80px;
        height: 80px;
    }
    .member-info {
        flex: 1 1 100%;
        text-align: center;
    }
    .action-buttons {
        width: 100%;
        justify-content: center;
    }
    .admin-stats {
        flex-direction: column;
    }
    .stat-card {
        flex: none;
    }
    .matchmaker-fab {
        bottom: 85px;
        right: 12px;
    }
    .matchmaker-avatar {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    .matchmaker-fab .matchmaker-label {
        font-size: 10px;
    }
    .auth-card {
        padding: 24px 16px;
        width: 96%;
    }
    .logo {
        font-size: 18px;
    }
    .save-app-btn {
        font-size: 11px;
        padding: 4px 12px;
    }
    .news-ticker {
        height: 40px;
    }
    .news-ticker span {
        font-size: 15px;
    }
    .main-header {
        top: 40px;
        padding: 6px 12px;
    }
    .page {
        margin-top: 100px;
        padding: 12px;
    }
    .form-nav-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
    .form-container {
        padding: 18px 14px;
    }
    .dropdown-menu {
        max-height: 180px;
    }
    .message-bubble .message-time {
        font-size: 9px;
    }
    .call-btn {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }
    .call-btn span {
        font-size: 14px;
    }
    .call-btn-input {
        font-size: 20px;
        width: 34px;
        height: 34px;
    }
    .modal-content {
        padding: 20px 16px;
    }
    #incomingCallScreen .caller-avatar {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    #incomingCallScreen .call-actions button {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    .age-range {
        flex-direction: row;
        gap: 8px;
    }
    .age-range .age-field {
        flex: 1;
    }
    #chatInputArea {
        padding: 6px 10px;
        gap: 4px;
    }
    #chatInput {
        font-size: 14px;
        padding: 8px 12px;
    }
    #chatInputArea button {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    #callActivationModal .modal-content {
        padding: 24px 16px;
    }
    #callActivationModal .btn-activate,
    #callActivationModal .btn-decline {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    #redirectToGMModal .modal-content {
        padding: 24px 16px;
    }
    #adminAutoReplyModal .modal-content {
        padding: 20px 16px;
    }
    #adminAutoReplyUserInfo {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .admin-reply-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .admin-reply-item .reply-actions {
        width: 100%;
        justify-content: flex-end;
    }
    #lmAutoReplyModal .auto-reply-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    #lmAutoReplyModal .auto-reply-item .reply-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .admin-reply-btn {
        font-size: 10px;
        padding: 3px 10px;
    }
}

@media (max-width: 400px) {
    .profile-avatar {
        width: 90px;
        height: 90px;
        font-size: 42px;
    }
    .member-card .avatar {
        width: 70px;
        height: 70px;
    }
    .matchmaker-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .matchmaker-fab {
        bottom: 78px;
        right: 10px;
    }
    .save-app-btn {
        font-size: 10px;
        padding: 3px 10px;
    }
    .auth-card {
        padding: 20px 14px;
    }
    .auth-card h2 {
        font-size: 20px;
    }
    .auth-card img {
        width: 80px !important;
        height: 80px !important;
    }
    .modal-content {
        padding: 16px 12px;
    }
    #authLoadingOverlay > div {
        padding: 20px 24px;
    }
    #callActivationModal .btn-activate,
    #callActivationModal .btn-decline {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 80px;
    }
    #adminAutoReplyModal .modal-content {
        padding: 16px 12px;
    }
    #adminNewReplyText,
    #newReplyText {
        font-size: 14px;
        padding: 10px 12px;
        min-height: 40px;
    }
    .call-btn-input {
        font-size: 18px;
        width: 30px;
        height: 30px;
    }
}

.shimmer-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}