/* =========================================================
   إعادة ضبط التنسيقات الأساسية
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
}

body {
    background: #05060a;
    color: #f5f5f5;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* =========================================================
   شريط التنقل
========================================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8%;
    background: rgba(5, 6, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-weight: 700;
    color: #00e0ff;
}

.navbar nav a {
    margin-left: 18px;
    text-decoration: none;
    color: #ddd;
    transition: 0.2s;
}

.navbar nav a:hover {
    color: #00e0ff;
}

/* =========================================================
   قسم الهيرو
========================================================= */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8%;
    background: radial-gradient(circle at top, #1f2937 0, #05060a 55%);
}

.primary-btn {
    background: linear-gradient(135deg, #00e0ff, #6366f1);
    border: none;
    color: #05060a;
    padding: 10px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.25s;
}

.primary-btn:hover {
    transform: scale(1.05);
}

/* =========================================================
   الأقسام العامة
========================================================= */
.section {
    padding: 60px 8%;
}

/* =========================================================
   الكروت في الصفحة الرئيسية
========================================================= */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: #0b0f19;
    border-radius: 14px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    cursor: pointer;
    transition: 0.15s;
}

.card-img {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-bottom: 12px;
}

.card:hover {
    transform: translateY(-4px);
    border-color: #00e0ff;
}

/* =========================================================
   نموذج التواصل
========================================================= */
form {
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input, textarea {
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 10px;
    color: #e5e7eb;
    transition: 0.15s;
}

input:focus, textarea:focus {
    border-color: #00e0ff;
    box-shadow: 0 0 0 1px rgba(0, 224, 255, 0.4);
}

/* =========================================================
   قسم آراء العملاء
========================================================= */
.testimonials-section {
    text-align: center;
    padding: 40px;
}

.reviews-note {
    text-align: center;
    font-size: 18px;
    margin-bottom: 25px;
    color: #9ca3af;
}

.review-form {
    max-width: 600px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-form input,
.review-form textarea {
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 18px;
    background: #020617;
    color: #e5e7eb;
}

.reviews-list {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-box {
    background: #57ebc63b;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: right;
    position: relative;
    padding-top: 40px;
}

.review-box h3 {
    margin-bottom: 10px;
    color: #000;
}

.delete-btn {
    background: #462e2d;
    color: #fff;
}

.pin-btn {
    background: #3c5870;
    color: #fff;
}

.member-tag {
    display: inline-block;
    background: #25a344;
    color: #09ebba;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
}

/* =========================================================
   الفوتر
========================================================= */
.footer {
    text-align: center;
    padding: 18px 8%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: #9ca3af;
}

/* =========================================================
   الوضع الفاتح (Light Mode)
========================================================= */
body.light {
    background: #f9fafb;
    color: #111827;
}

body.light .navbar {
    background: rgba(249, 250, 251, 0.95);
}

body.light .card,
body.light .ad-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.35);
}

body.light input,
body.light textarea {
    background: #ffffff;
    color: #111827;
    border-color: #cbd5e1;
}

/* =========================================================
   تنسيقات الخدمات
========================================================= */
.service-img {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin: 0 auto 15px;
}

.service-title {
    text-align: right;
}

.service-text {
    margin-bottom: 20px;
    color: #cbd5e1;
    line-height: 1.8;
}

/* =========================================================
   شبكة الإعلانات
========================================================= */
#adsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 25px;
}

.ad-card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 14px;
    padding: 12px;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 340px;
    transition: 0.25s;
    cursor: pointer;
    overflow: hidden;
}

.ad-card:hover {
    transform: translateY(-4px);
    border-color: #00e0ff;
    box-shadow: 0 6px 18px rgba(0, 224, 255, 0.25);
}

.ad-card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ⭐ إصلاح التحذير الأصفر */
.ad-card .description-preview {
    font-size: 0.9rem;
    color: #94a3b8;

    overflow: hidden;
    text-overflow: ellipsis;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    margin-bottom: auto;
}

.ad-card .price {
    font-size: 1rem;
    font-weight: bold;
    color: #4ade80;
    margin: 8px 0;
}

.chat-btn {
    background: #0ea5e9;
    padding: 8px;
    border-radius: 8px;
    color: white;
    text-align: center;
    border: none;
    cursor: pointer;
    margin-top: auto;
    transition: 0.2s;
}

.chat-btn:hover {
    background: #0284c7;
}

/* =========================================================
   عرض الصور المتعددة داخل الإعلان
========================================================= */
.ad-images {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 5px 0;
}

.ad-images img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid #1f2937;
}

/* =========================================================
   نافذة نشر إعلان
========================================================= */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.popup-box {
    background: #0f172a;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    border-radius: 14px;
    border: 1px solid #1f2937;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: popupShow 0.25s ease;
}

.popup-box h2 {
    margin-bottom: 15px;
    color: #00e0ff;
    text-align: center;
}

.close-btn {
    background: #dc2626;
    margin-top: 10px;
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    color: white;
    border: none;
    cursor: pointer;
}

/* =========================================================
   نافذة الدردشة
========================================================= */
.chat-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    height: 480px;
    background: #0f172a;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

.chat-header {
    background: #0ea5e9;
    padding: 12px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #1e293b;
}

.chat-message {
    background: #334155;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #e2e8f0;
    font-size: 15px;
    line-height: 1.4;
    border-left: 3px solid #0ea5e9;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background: #0f172a;
    border-top: 1px solid #1e293b;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #1e293b;
    color: white;
    font-size: 14px;
}

.chat-input-area button {
    margin-left: 10px;
    padding: 10px 14px;
    background: #0ea5e9;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* =========================================================
   زر تسجيل الدخول العائم
========================================================= */
.login-floating-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    background: #007bff;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: 0.3s;
    z-index: 9999;
}

.login-floating-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

/* =========================================================
   نافذة تكبير الصور
========================================================= */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0,0,0,0.6);
}

.close-viewer {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 45px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* =========================================================
   حركة ظهور النوافذ
========================================================= */
@keyframes popupShow {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
