/* ============================================
   طريق العفاف - التصميم الاحترافي v2.0
   ============================================ */

/* استيراد الخطوط */
@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@300;400;500;600;700;800&display=swap');

/* ===== المتغيرات العامة ===== */
:root {
    --primary: #2d5a3d;
    --primary-light: #3d7a4f;
    --primary-dark: #1e3d28;
    --primary-bg: #f0f7f2;
    --secondary: #c8995a;
    --secondary-light: #e0b97a;
    --accent: #b8864a;
    
    --bg-cream: #faf7f2;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8f6f3;
    --bg-hover: #f0ece6;
    
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-muted: #9a9ab0;
    --text-light: #b8b8cc;
    --text-on-primary: #ffffff;
    
    --border: #e8e4de;
    --border-light: #f0ece6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(45, 90, 61, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 50px;
    
    --font-primary: 'Noto Kufi Arabic', 'Segoe UI', Tahoma, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    --nav-height: 72px;
    --header-height: 64px;
}

/* ===== ريسيت أساسي ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 16px);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== سكرول مخصص ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== الروابط ===== */
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ===== الحقول ===== */
input, select, textarea, button {
    font-family: var(--font-primary);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1) !important;
}

/* ===== شريط الأخبار ===== */
.news-ticker {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #e8f0e8;
    padding: 10px 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 1001;
    overflow: hidden;
    white-space: nowrap;
}

.news-ticker span {
    display: inline-block;
    animation: tickerScroll 20s linear infinite;
    padding-left: 100%;
}

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

/* ===== الهيدر الرئيسي ===== */
.main-header {
    background: var(--bg-white);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 40px;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
    min-height: var(--header-height);
}

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

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

.logo span {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.save-app-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.save-app-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.notification-icon {
    position: relative;
    font-size: 22px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: 50%;
    transition: var(--transition);
}

.notification-icon:hover {
    background: var(--bg-hover);
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ===== الصفحات ===== */
.page {
    display: none;
    animation: fadeInUp 0.4s ease;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ===== بطاقة البحث ===== */
.search-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

/* ===== التبويبات ===== */
.tabs-container {
    display: flex;
    gap: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active-tab {
    display: block;
}

/* ===== مجموعات الفلترة ===== */
.filter-group {
    margin-bottom: 14px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.gender-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

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

.age-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.age-range input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-input);
    transition: var(--transition);
}

.age-range span {
    color: var(--text-muted);
    font-size: 13px;
}

select, .search-card select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a5a7a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}

/* ===== زر البحث ===== */
.search-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

/* ===== نتائج البحث ===== */
#searchResults {
    min-height: 120px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px dashed var(--border);
}

/* ===== بطاقة عضو/نتيجة ===== */
.member-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    animation: scaleIn 0.3s ease;
}

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

.member-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-bg), var(--bg-cream));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    overflow: hidden;
}

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

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

.member-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.member-details {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.member-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.member-tag {
    padding: 3px 10px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

/* ===== التنقل السفلي ===== */
.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 400px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 6px;
    display: flex;
    justify-content: space-around;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.8);
    z-index: 999;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    min-width: 50px;
}

.nav-item:hover {
    background: var(--bg-input);
}

.nav-item.active {
    background: var(--primary-bg);
}

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

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
}

.nav-icon {
    font-size: 22px;
    transition: var(--transition);
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

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

/* ===== صفحة البروفايل ===== */
.profile-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 1px solid var(--border-light);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-bg), #e0ece3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    margin: 0 auto 16px;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-glow);
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.online-dot {
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
    position: absolute;
}

.profile-card h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.edit-btn {
    width: 100%;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.edit-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ===== صفحة الاستمارة ===== */
.form-container {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.form-container h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.form-container > p {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== شريط التقدم ===== */
.progress-bar {
    height: 6px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ===== خطوات الاستمارة ===== */
.form-step {
    animation: fadeIn 0.3s ease;
}

.form-step h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-bg);
}

.form-step label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    margin-top: 12px;
}

.form-step input[type="text"],
.form-step input[type="number"],
.form-step input[type="date"],
.form-step input[type="tel"],
.form-step textarea,
.form-step select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-input);
    transition: var(--transition);
    color: var(--text-primary);
}

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

/* ===== راديو جريد ===== */
.radio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid transparent;
}

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

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

.radio-item:has(input:checked) {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

/* ===== أزرار التنقل في الاستمارة ===== */
.form-nav-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

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

.form-nav-btn.next {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-sm);
}

.form-nav-btn.next:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.form-nav-btn.prev {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.form-nav-btn.prev:hover {
    background: var(--bg-hover);
}

.submit-form-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== ملخص الاستمارة ===== */
#formSummary {
    background: var(--primary-bg);
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
    border: 1px solid rgba(45,90,61,0.1);
}

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

.dropdown-input {
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    user-select: none;
}

.dropdown-input.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,90,61,0.1);
}

.dropdown-input .placeholder {
    color: var(--text-muted);
    font-size: 14px;
}

.dropdown-input .selected-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.arrow {
    transition: var(--transition);
    color: var(--text-muted);
    font-size: 12px;
}

.arrow.open {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    animation: scaleIn 0.2s ease;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ===== نافذة تسجيل الدخول ===== */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="number"],
.auth-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-input);
    margin-bottom: 12px;
    transition: var(--transition);
}

.auth-card button {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.auth-card button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ===== صفحة المحادثة ===== */
#chatPage {
    position: fixed;
    inset: 0;
    background: var(--bg-cream);
    z-index: 1002;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-on-primary);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.chat-back-btn {
    background: none;
    border: none;
    color: var(--text-on-primary);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.chat-back-btn:hover {
    background: rgba(255,255,255,0.1);
}

.chat-partner-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.chat-partner-name {
    font-weight: 700;
    font-size: 16px;
}

.chat-partner-status {
    font-size: 11px;
    opacity: 0.7;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f5efe8;
}

.chat-input-bar {
    background: var(--bg-white);
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
}

.chat-input-bar input {
    flex: 1;
    padding: 12px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 15px;
    background: var(--bg-input);
    transition: var(--transition);
}

.chat-input-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,90,61,0.1);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* ===== فقاعات المحادثة ===== */
.message-bubble {
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.6;
    animation: scaleIn 0.2s ease;
    position: relative;
}

.message-sent {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

.message-received {
    background: var(--bg-white);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

/* ===== قائمة المحادثات ===== */
.chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-list-item {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.chat-list-item:hover {
    transform: translateX(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

/* ===== نافذة اختيار الصورة ===== */
.avatar-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.avatar-modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease;
}

.avatar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.avatar-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.avatar-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.avatar-modal-close:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 20px;
}

.avatar-grid-item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.avatar-grid-item:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: scale(1.05);
}

.avatar-grid-item.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: var(--shadow-glow);
}

/* ===== صفحة الأدمن ===== */
.admin-panel {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--primary-bg);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    border: 1px solid rgba(45,90,61,0.1);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ===== زر الخاطبة ===== */
.matchmaker-fab {
    position: fixed;
    bottom: 90px;
    left: 16px;
    z-index: 998;
    cursor: pointer;
    transition: var(--transition);
}

.matchmaker-fab:hover {
    transform: scale(1.05);
}

.matchmaker-content {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 10px 18px 10px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.matchmaker-content:hover {
    box-shadow: var(--shadow-xl);
}

.matchmaker-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

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

.matchmaker-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== صفحة "من نحن" ===== */
.about-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.about-content h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
}

.about-content p {
    font-size: 14px;
    line-height: 2;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ===== توجيه التثبيت ===== */
#installGuide {
    position: fixed;
    bottom: 95px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark);
    color: var(--text-on-primary);
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    max-width: 90%;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    animation: fadeInUp 0.3s ease;
    display: none;
}

/* ===== حالات التحميل ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== توست الإشعارات ===== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark);
    color: var(--text-on-primary);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: fadeInUp 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
.toast.info { background: var(--primary-dark); }

/* ===== صفحة المراسلات ===== */
#messagesPage h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== لوحة تحكم الأدمن ===== */

.admin-dashboard {
  max-width: 800px;
  margin: 0 auto;
}

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

.admin-header h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.admin-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.admin-refresh-btn {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.admin-refresh-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* شبكة الإحصائيات */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.admin-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 10px;
}

.stat-icon.users { background: #dbeafe; }
.stat-icon.forms { background: #fef3c7; }
.stat-icon.messages { background: #d1fae5; }
.stat-icon.settings { background: #ede9fe; }

.stat-info { margin-bottom: 6px; }

.stat-number {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-change {
  font-size: 11px;
  color: #16a34a;
  font-weight: 600;
}

.stat-change.warning { color: #d97706; }

/* تبويبات الأدمن */
.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.admin-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.admin-tab:hover:not(.active) {
  background: var(--bg-hover);
}

/* محتوى التبويبات */
.admin-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.admin-tab-content.active {
  display: block;
}

.admin-section {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-section-header h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.admin-search input {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  background: var(--bg-input);
  min-width: 200px;
  transition: var(--transition);
}

.admin-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45,90,61,0.1);
}

.admin-filters select {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  background: var(--bg-input);
}

/* الجدول */
.admin-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead th {
  background: var(--primary-bg);
  padding: 10px 12px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  border-bottom: 2px solid rgba(45,90,61,0.1);
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: var(--primary-bg);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* حالة الاستمارة */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.approved {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* أزرار الإجراءات */
.admin-action-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.admin-action-btn.view {
  background: #dbeafe;
  color: #1e40af;
}

.admin-action-btn.view:hover { background: #bfdbfe; }

.admin-action-btn.approve {
  background: #d1fae5;
  color: #065f46;
}

.admin-action-btn.approve:hover { background: #a7f3d0; }

.admin-action-btn.reject {
  background: #fee2e2;
  color: #991b1b;
}

.admin-action-btn.reject:hover { background: #fecaca; }

.admin-action-btn.delete {
  background: var(--bg-input);
  color: #6b7280;
}

.admin-action-btn.delete:hover { background: #e5e7eb; }

.admin-action-btn.toggle-on {
  background: #d1fae5;
  color: #065f46;
}

.admin-action-btn.toggle-off {
  background: var(--bg-input);
  color: var(--text-muted);
}

/* قائمة الرسائل في الأدمن */
.admin-messages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-msg-item {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border-light);
}

.admin-msg-item.unread {
  background: var(--primary-bg);
  border-color: rgba(45,90,61,0.2);
}

.admin-msg-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.admin-msg-content {
  flex: 1;
  min-width: 0;
}

.admin-msg-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.admin-msg-from {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.admin-msg-time {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-msg-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.admin-msg-delete {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.4;
  transition: var(--transition);
  padding: 4px;
}

.admin-msg-delete:hover { opacity: 1; }

/* الإعدادات */
.settings-group {
  margin-bottom: 16px;
}

.settings-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.settings-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.settings-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-input);
}

.settings-row button {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.settings-row button:hover {
  background: var(--primary-light);
}

.matchmaker-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid var(--border);
}

/* الإجراءات السريعة */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.quick-btn.export {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.quick-btn.export:hover { background: var(--primary); color: white; }

.quick-btn.danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1.5px solid #fecaca;
}

.quick-btn.danger:hover { background: #dc2626; color: white; border-color: #dc2626; }

/* فارغ */
.admin-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== ريسبونسيف ===== */
@media (max-width: 600px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-search input {
    width: 100%;
    min-width: 0;
  }

  .admin-filters select {
    width: 100%;
  }

  .settings-row {
    flex-direction: column;
  }

  .settings-row button {
    width: 100%;
  }

  .quick-actions {
    flex-direction: column;
  }

  .quick-btn {
    min-width: 0;
  }
}

@media (max-width: 480px) {
    .page { padding: 12px; }
    .search-card { padding: 16px; }
    .profile-card { padding: 20px 16px; }
    .form-container { padding: 20px 16px; }
    .auth-card { padding: 24px 20px; }
    .avatar-grid { grid-template-columns: repeat(3, 1fr); }
    .gender-options { gap: 10px; }
    .radio-item { padding: 6px 12px; font-size: 11px; }
    .logo { font-size: 17px; }
    .chat-partner-name { font-size: 14px; }

    .admin-tab { font-size: 12px; padding: 8px 14px; }
    .admin-table { font-size: 12px; }
    .admin-table thead th,
    .admin-table tbody td { padding: 8px 10px; }
    .admin-stat-card { padding: 12px; }
    .stat-number { font-size: 22px; }
}

@media (min-width: 768px) {
    body { padding-bottom: calc(var(--nav-height) + 24px); }
    .page { padding: 24px; max-width: 700px; }
    .admin-dashboard { max-width: 900px; }
    .bottom-nav { max-width: 450px; }
}

/* ===== تصدير (طباعة) ===== */
@media print {
    .bottom-nav, .main-header, .news-ticker, .matchmaker-fab, #installGuide, .toast {
        display: none !important;
    }
    body { padding-bottom: 0; background: white; }
    .page { display: block !important; }
}
