/* ============================================
   الملف: style.css (طريق العفاف - الإصدار النهائي)
   ============================================ */

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

body {
    font-family: 'Cairo', 'Tajawal', 'Tahoma', 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: #1e2a47;
    padding-bottom: 75px;
    min-height: 100vh;
}

:root {
    --dark-blue: #1e2a47;
    --orange: #e67e22;
    --orange-dark: #d35400;
    --light-bg: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --green-online: #2ecc71;
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
    --avatar-bg: #d1d5db;
    --avatar-text: #6b7280;
}

/* ========== شريط الأخبار ========== */
.news-ticker {
    background: var(--dark-blue);
    color: white;
    padding: 10px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    font-size: 14px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.news-ticker span {
    display: inline-block;
    animation: scrollNews 25s linear infinite;
    font-weight: 500;
    letter-spacing: 0.5px;
}
@keyframes scrollNews {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========== الهيدر ========== */
.main-header {
    background: var(--light-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 36px;
    width: 100%;
    z-index: 999;
    border-bottom: 1px solid var(--border-color);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 24px; font-weight: bold; color: var(--dark-blue); }
.save-app-btn {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white; border: none; padding: 6px 16px; border-radius: 20px;
    font-size: 13px; font-weight: bold; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 2px 8px rgba(230,126,34,0.3);
    white-space: nowrap;
}
.save-app-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(230,126,34,0.4); }
.save-app-btn:active { transform: scale(0.95); }
.notification-icon { font-size: 24px; position: relative; cursor: pointer; transition: transform 0.2s; }
.notification-icon:hover { transform: scale(1.1); }
.badge {
    position: absolute; top: -5px; right: -10px;
    background: #e74c3c; color: white; border-radius: 50%;
    padding: 2px 6px; font-size: 10px; font-weight: bold;
    display: none;
}

/* ========== التنقل السفلي ========== */
.bottom-nav {
    position: fixed; bottom: 0; width: 100%;
    background: var(--light-bg); backdrop-filter: blur(15px);
    display: flex; justify-content: space-around;
    padding: 10px 0 12px; border-top: 1px solid var(--border-color);
    z-index: 1000; box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}
.nav-item {
    text-align: center; font-size: 11px; color: #7f8c8d;
    cursor: pointer; transition: all 0.2s ease;
    padding: 4px 8px; border-radius: 20px; user-select: none;
}
.nav-item.active { color: var(--orange); font-weight: bold; background: rgba(230,126,34,0.1); }
.nav-item:hover { transform: translateY(-2px); color: var(--orange); }
.nav-icon { font-size: 20px; display: block; margin-bottom: 2px; }

/* ========== الصفحات ========== */
.page { display: none; margin-top: 105px; padding: 16px; padding-bottom: 30px; animation: fadeIn 0.3s ease; }
.page.active-page { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ========== من نحن ========== */
.about-card { background: white; border-radius: 28px; padding: 24px; box-shadow: var(--shadow-sm); }
.about-card h2 { color: var(--dark-blue); font-size: 24px; margin-bottom: 16px; text-align: center; }
.about-content { color: #2d3748; line-height: 1.8; font-size: 16px; text-align: justify; }
.about-content p { margin-bottom: 12px; }

/* ========== بطاقات الأعضاء ========== */
.member-card {
    background: white; border-radius: 24px; padding: 16px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow-sm); transition: all 0.3s ease;
    border-top: 3px solid var(--orange);
}
.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.avatar {
    width: 65px; height: 65px; background: var(--avatar-bg); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: var(--avatar-text);
    position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-shrink: 0; overflow: hidden; border: 2px solid #e5e7eb;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.online-dot {
    position: absolute; bottom: 3px; right: 3px;
    width: 14px; height: 14px; background: var(--green-online);
    border-radius: 50%; border: 2px solid white;
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: bold; font-size: 17px; color: var(--dark-blue); }
.member-detail { font-size: 13px; color: #7f8c8d; margin-top: 4px; }
.action-buttons { display: flex; gap: 12px; flex-shrink: 0; }
.btn-like, .btn-message {
    background: none; border: none; font-size: 24px; cursor: pointer;
    transition: all 0.2s ease; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.btn-like { color: #ddd; background: rgba(0,0,0,0.05); }
.btn-like.liked { color: #e74c3c; background: rgba(231,76,60,0.15); }
.btn-like:hover { transform: scale(1.15); }
.btn-message { color: var(--orange); background: rgba(230,126,34,0.1); }
.btn-message:hover { transform: scale(1.15); background: rgba(230,126,34,0.2); }

/* ========== البحث ========== */
.search-card { background: var(--light-bg); backdrop-filter: blur(10px); border-radius: 28px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.search-card h3 { color: var(--dark-blue); margin-bottom: 18px; font-size: 20px; }
.filter-group { margin-bottom: 18px; }
.filter-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; color: var(--dark-blue); }
.age-range { display: flex; gap: 12px; align-items: center; }
.age-range input { flex: 1; padding: 12px; border: 1px solid var(--border-color); border-radius: 16px; font-size: 14px; transition: all 0.2s; background: white; }
.age-range input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(230,126,34,0.1); }
.gender-options { display: flex; gap: 20px; }
.gender-options label { display: inline-flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
select { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 16px; font-size: 14px; background: white; cursor: pointer; font-family: inherit; }
.search-btn {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white; border: none; padding: 14px; border-radius: 40px;
    width: 100%; font-size: 16px; font-weight: bold; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(230,126,34,0.3);
}
.search-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(230,126,34,0.4); }
.no-results { text-align: center; padding: 50px; background: white; border-radius: 24px; color: #7f8c8d; font-size: 16px; }

/* ========== قائمة المحادثات ========== */
.chat-list { background: white; border-radius: 24px; padding: 8px; box-shadow: var(--shadow-sm); }
.chat-item {
    display: flex; align-items: center; gap: 14px; padding: 14px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s; border-radius: 16px; cursor: pointer;
}
.chat-item:hover { background: rgba(230,126,34,0.05); }
.chat-item .avatar { width: 50px; height: 50px; font-size: 22px; }
.chat-preview { flex: 1; min-width: 0; }
.chat-name { font-weight: bold; color: var(--dark-blue); }
.chat-last { font-size: 12px; color: #95a5a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ========== صفحة المحادثة ========== */
#chatPage {
    margin-top: 0; padding: 0; height: 100vh; background: #f0f2f5;
    display: none; flex-direction: column; position: fixed; top: 0; left: 0; width: 100%; z-index: 2000;
    animation: slideUp 0.3s ease;
}
#chatPage.active-page { display: flex; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
#chatMessagesContainer { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #f0f2f5; }
.message-bubble {
    max-width: 75%; padding: 10px 16px; border-radius: 18px; font-size: 15px; line-height: 1.5;
    word-wrap: break-word; animation: fadeInMsg 0.2s ease;
}
@keyframes fadeInMsg { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.message-bubble.me { background: var(--orange); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.message-bubble.other { background: white; color: #1e2a47; align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.chat-input-area {
    background: white; padding: 12px 16px; border-top: 1px solid #ddd;
    display: flex; gap: 10px; flex-shrink: 0;
}
.chat-input-area input { flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 25px; font-size: 16px; font-family: inherit; outline: none; }
.chat-input-area input:focus { border-color: var(--orange); }
.chat-input-area button {
    background: var(--orange); color: white; border: none; border-radius: 50%;
    width: 50px; height: 50px; font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0;
}
.chat-input-area button:hover { transform: scale(1.05); background: var(--orange-dark); }

/* ========== البروفايل ========== */
.profile-card { background: white; border-radius: 32px; padding: 30px 20px; text-align: center; box-shadow: var(--shadow-md); }
.profile-avatar {
    width: 110px; height: 110px; margin: 0 auto 16px; position: relative;
    cursor: pointer; border-radius: 50%; overflow: hidden;
    background: var(--avatar-bg); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); border: 3px solid #e5e7eb;
}
.profile-avatar .default-avatar { font-size: 52px; color: var(--avatar-text); line-height: 1; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .online-dot { position: absolute; bottom: 8px; right: 8px; width: 16px; height: 16px; background: var(--green-online); border-radius: 50%; border: 2px solid white; }
.edit-btn { background: var(--orange); border: none; padding: 10px 28px; border-radius: 40px; color: white; margin-top: 16px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.edit-btn:hover { background: var(--orange-dark); transform: scale(1.02); }
#fansList { background: #f8f9fa; border-radius: 16px; padding: 12px; margin-top: 8px; text-align: right; font-size: 14px; color: #555; max-height: 100px; overflow-y: auto; }
.fan-item { display: inline-block; background: white; padding: 4px 12px; border-radius: 20px; margin: 4px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); font-size: 13px; }

/* ========== نوافذ المصادقة ========== */
.auth-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(8px);
    z-index: 3000; display: flex; align-items: center; justify-content: center;
}
.auth-card {
    background: white; border-radius: 32px; padding: 32px;
    width: 90%; max-width: 400px; max-height: 90vh; overflow-y: auto;
    text-align: center; box-shadow: var(--shadow-lg);
}
.auth-card h2 { color: var(--dark-blue); margin-bottom: 8px; }
.auth-card p { color: #555; margin-bottom: 16px; font-size: 14px; }
.auth-card input, .auth-card select, .auth-card textarea {
    width: 100%; padding: 14px; margin-bottom: 16px;
    border: 1px solid var(--border-color); border-radius: 16px;
    font-size: 16px; font-family: inherit; background: white;
}
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus {
    outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(230,126,34,0.1);
}
.auth-card .btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white; border: none; padding: 14px; border-radius: 40px;
    width: 100%; font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.2s;
}
.auth-card .btn-primary:hover { transform: translateY(-2px); }
.auth-card .btn-success { background: #27ae60; color: white; border: none; padding: 14px; border-radius: 40px; width: 100%; font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.auth-card .btn-success:hover { transform: translateY(-2px); background: #219a52; }
.auth-card .btn-secondary { background: #7f8c8d; color: white; border: none; padding: 14px; border-radius: 40px; width: 100%; font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.auth-card .btn-secondary:hover { transform: translateY(-2px); background: #6b7a7b; }

.auth-card .divider {
    display: flex; align-items: center; gap: 16px; margin: 20px 0;
    color: #aaa; font-size: 14px;
}
.auth-card .divider::before, .auth-card .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border-color);
}

.btn-google {
    background: white; color: #555; border: 1px solid #ddd;
    padding: 14px; border-radius: 40px; width: 100%;
    font-size: 16px; font-weight: bold; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 12px;
    transition: all 0.2s;
}
.btn-google:hover { background: #f8f9fa; border-color: #bbb; transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.btn-google .google-icon { font-size: 22px; }

/* ========== لوحة الأدمن ========== */
.admin-panel { background: white; border-radius: 28px; padding: 24px; box-shadow: var(--shadow-sm); }
.admin-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card { background: linear-gradient(135deg, #f8f9fa, #fff); padding: 16px; border-radius: 20px; flex: 1; text-align: center; border: 1px solid var(--border-color); font-weight: bold; min-width: 80px; }
.admin-list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: white; border-radius: 12px; margin-bottom: 6px; border: 1px solid var(--border-color); transition: all 0.2s; }
.admin-list-item:hover { background: #f8f9fa; }
.admin-list-item .info { flex: 1; font-size: 14px; }
.admin-list-item .info .name { font-weight: bold; }
.admin-list-item .info .detail { color: #7f8c8d; font-size: 12px; }
.admin-list-item .actions { display: flex; gap: 8px; }
.admin-list-item .actions button { border: none; padding: 6px 12px; border-radius: 20px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.admin-list-item .actions .edit-btn-sm { background: var(--orange); color: white; }
.admin-list-item .actions .edit-btn-sm:hover { background: var(--orange-dark); }
.admin-list-item .actions .delete-btn-sm { background: #e74c3c; color: white; }
.admin-list-item .actions .delete-btn-sm:hover { background: #c0392b; }

/* ========== عام ========== */
.hidden { display: none !important; }
button { cursor: pointer; }
hr { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }

/* ========== استجابة الجوال ========== */
@media (max-width: 480px) {
    .member-card { flex-wrap: wrap; justify-content: center; text-align: center; }
    .member-info { flex: 1 1 100%; text-align: center; }
    .action-buttons { width: 100%; justify-content: center; }
    .gender-options { flex-wrap: wrap; gap: 10px; }
    .age-range { flex-wrap: wrap; }
    .admin-stats { flex-direction: column; }
    .stat-card { flex: none; }
    .auth-card { padding: 24px 16px; width: 95%; }
    .message-bubble { max-width: 85%; font-size: 14px; padding: 8px 14px; }
    .chat-input-area { padding: 8px 12px; }
    .chat-input-area input { font-size: 14px; padding: 10px; }
    .chat-input-area button { width: 44px; height: 44px; font-size: 18px; }
    .profile-avatar { width: 90px; height: 90px; }
    .profile-avatar .default-avatar { font-size: 42px; }
    .save-app-btn { font-size: 11px; padding: 4px 12px; }
    .logo { font-size: 18px; }
    .header-left { gap: 8px; }
    .nav-item { font-size: 10px; padding: 2px 6px; }
    .nav-icon { font-size: 18px; }
    .about-content { font-size: 14px; }
    .about-card { padding: 16px; }
}