/* ========================================================= */
/* FINAL CSS - FULLY RESPONSIVE MOBILE VERSION               */
/* ========================================================= */

/* --- 1. متغيرات الألوان والمسافات --- */
:root {
    /* Colors */
    --primary-dark-bg: #1C1E23;
    --secondary-dark-bg: #22252A;
    --tertiary-dark-bg: #2A2F35;
    --text-light: #E0E0E0;
    --text-muted: #A0AEC0;
    --brand-accent: #E0E0E0; /* White Accent */
    --border-dark: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(224, 224, 224, 0.6); /* White glow */

    /* Spacing System */
    --space-xs: 6px; --space-sm: 10px; --space-md: 14px; --space-lg: 16px; --space-xl: 20px; --space-xxl: 24px;
}

/* --- 2. الإعدادات الأساسية والهيكل --- */
.strategic-hub {
    position: relative;
    width: 100%;
    height: 100vh; /* Fallback for older browsers */
    height: 100dvh; /* Modern solution */
    overflow: hidden; /* يمنع أي حركة غير مرغوب فيها */
    font-family: 'Poppins', sans-serif;
    background: #eef2f5;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 1;
}

/* --- 3. تصميم لوحة التحكم الجانبية (للسطح المكتب) --- */
.hub-panel {
    position: absolute;
    z-index: 2;
    width: 360px;
    top: 50%;
    transform: translateY(-50%);
    max-height: calc(100vh - var(--space-xxl) * 2);
    overflow-y: auto;
    color: var(--text-muted);
    border-radius: 16px;
    border: 1px solid var(--border-dark);
    background-color: rgba(28, 30, 35, 0.9);
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    left: -420px; /* Start off-screen */
    transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.hub-panel.is-location-view {
    left: var(--space-xxl);
}

.hub-panel .panel-content { padding: var(--space-lg); }

/* Reset Button */
#reset-panel-btn { position: absolute; top: var(--space-md); right: var(--space-md); background: var(--secondary-dark-bg); border: 1px solid var(--border-dark); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: var(--text-muted); cursor: pointer; transition: all 0.3s ease; opacity: 0; pointer-events: none; z-index: 5; }
#reset-panel-btn:hover { transform: scale(1.1) rotate(90deg); color: var(--text-light); background-color: var(--tertiary-dark-bg); }
.hub-panel.is-location-view #reset-panel-btn { opacity: 1; pointer-events: all; transition-delay: 0.3s; }

/* --- CARD COMPONENTS --- */
.card-header { position: relative; height: 150px; border-radius: 12px; overflow: hidden; }
.card-header-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; }

.card-title-section { padding: var(--space-lg) 0; border-bottom: 1px solid var(--border-dark); }
.card-title { font-weight: 700; font-size: 24px; color: var(--text-light); margin: 0; line-height: 1.3; }
.card-tags { display: flex; gap: var(--space-xs); margin-bottom: var(--space-sm); flex-wrap: wrap; }
.card-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; background-color: var(--secondary-dark-bg); color: var(--text-muted); border: 1px solid var(--border-dark); }

.card-body { padding: 0; }
.card-main-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); padding: var(--space-md) 0; border-bottom: 1px solid var(--border-dark); }
.card-stat { text-align: center; padding: var(--space-xs); }
.card-stat i { font-size: 18px; color: var(--brand-accent); margin-bottom: var(--space-xs); display: block; }
.card-stat span { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.card-stat span strong { display: block; color: var(--text-light); font-size: 14px; font-weight: 600; }
.card-tabs { display: flex; border-bottom: 1px solid var(--border-dark); margin-bottom: var(--space-lg); }
.tab-btn { flex: 1; padding: var(--space-md) var(--space-sm); text-align: center; font-weight: 600; color: var(--text-muted); cursor: pointer; background: none; border: none; border-bottom: 3px solid transparent; transition: all 0.2s ease; font-size: 14px; }
.tab-btn:hover { color: var(--text-light); }
.tab-btn.active { color: var(--text-light); border-bottom-color: var(--brand-accent); background-color: var(--tertiary-dark-bg); }
.tab-content { padding: 0; display: none; }
.tab-content.active { display: block; }
.card-desc { font-size: 14px; line-height: 1.7; color: var(--text-muted); margin: 0 0 var(--space-lg) 0; }
.progress-container { margin-top: var(--space-lg); padding: var(--space-sm) 0; border-top: 1px solid var(--border-dark); }
.progress-label { display: flex; justify-content: space-between; margin-bottom: var(--space-xs); font-size: 13px; color: var(--text-light); font-weight: 600; }
.progress-bar { background-color: var(--secondary-dark-bg); border-radius: 5px; height: 6px; overflow: hidden; }
.progress-bar-inner { width: 0%; height: 100%; background-color: var(--brand-accent); border-radius: 5px; }
.poi-list { display: flex; flex-direction: column; gap: var(--space-xs); }
.poi-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm); border-radius: 8px; transition: background-color 0.2s ease; }
.poi-item:hover { background-color: var(--secondary-dark-bg); }
.poi-item i { font-size: 16px; color: var(--brand-accent); width: 18px; text-align: center; }
.poi-item span { color: var(--text-muted); font-size: 13px; }
.card-actions { display: flex; gap: var(--space-sm); padding: var(--space-lg) 0 0 0; border-top: 1px solid var(--border-dark); margin-top: var(--space-lg); }
.card-actions a { flex: 1; text-decoration: none; text-align: center; padding: var(--space-md); border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.2s ease; border: none; }
.card-actions .primary-btn { background: var(--text-light); color: var(--primary-dark-bg); font-weight: 700; }
.card-actions .primary-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 15px -5px rgba(224, 224, 224, 0.3); filter: brightness(1.05); }
.card-actions .secondary-btn { background: var(--secondary-dark-bg); color: var(--text-light); border: 1px solid var(--border-dark); }
.card-actions .secondary-btn:hover { background-color: var(--tertiary-dark-bg); border-color: var(--brand-accent); }

/* --- Map Markers (Default Image Element) --- */
@keyframes white-pulse { 0% { box-shadow: 0 0 8px 2px var(--accent-glow); } 50% { box-shadow: 0 0 12px 4px var(--accent-glow); } 100% { box-shadow: 0 0 8px 2px var(--accent-glow); } }

/* The 'marker' class is now ONLY the image inside the container */
.marker { 
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.hq-marker-image { width: 70px; height: 70px; border-radius: 18px; background-size: cover; background-position: center; border: 4px solid var(--brand-accent); box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5); animation: white-pulse 2.5s infinite ease-in-out; position: relative; }
.hq-marker-image::after { content: '\f005'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; bottom: -8px; right: -8px; font-size: 22px; color: var(--brand-accent); background-color: var(--primary-dark-bg); border-radius: 50%; padding: 5px; border: 3px solid var(--brand-accent); box-shadow: 0 4px 8px rgba(0,0,0,0.5); }
.project-marker-image { width: 55px; height: 55px; border-radius: 50%; background-size: cover; background-position: center; border: 3px solid var(--text-light); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); }


/* ========================================================= */
/* ====== تنسيق المؤشر الثابت الجديد (Image + Label) ====== */
/* ========================================================= */

.custom-marker-container {
    display: flex; /* لترتيب الصورة والنص بجانب بعضهما */
    align-items: center; 
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35)); 
}

/* تأثير التكبير عند التحديد */
.custom-marker-container.is-active {
    transform: scale(1.15); 
    z-index: 10;
}
.custom-marker-container.is-active .hq-marker-image,
.custom-marker-container.is-active .project-marker-image {
    border-color: var(--brand-accent);
    box-shadow: 0 0 12px 2px var(--accent-glow);
    animation: none;
}

/* تنسيق اسم المشروع الثابت (الجديد: زيادة المسافة وتقوية الظل) */
.marker-label {
    /* الخلفية والحدود: تم إزالتها لتصبح شفافة */
    background: none; 
    border: none;
    padding: 0 12px 0 6px; 
    
    /* === التعديل الرئيسي: زيادة المسافة بين النص والصورة === */
    margin-left: 0px; /* لزيادة المسافة، نبدأ الهامش من صفر أو قيمة موجبة صغيرة */
    padding-left: 10px; /* نستخدم padding يسار لإبعاد النص عن الصورة قليلاً */
    
    /* تنسيق النص */
    color: var(--text-light);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap; 
    line-height: 1.2;
    
    /* === التعديل الرئيسي: تعزيز ظل النص ليظهر أكثر (توجه) === */
    text-shadow: 
        0px 0px 8px rgba(0, 0, 0, 1), /* ظل أقوى وأغمق للخلفية */
        0 0 3px rgba(0, 0, 0, 0.7),
        0 0 1px var(--text-light); /* إضاءة خفيفة للنص نفسه */
    
    transform: translateY(2px);
}

/* إخفاء صندوق الاتجاهات بالكامل لمنع المشاكل */
.directions-container {
    position: absolute;
    top: -1000px;
    left: -1000px;
    visibility: hidden;
    z-index: -1;
}

/* Skeleton Loader */
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { background-color: var(--primary-dark-bg); border-radius: 12px; padding: var(--space-lg); }
.skeleton { background: linear-gradient(90deg, var(--secondary-dark-bg) 25%, #383e44 50%, var(--secondary-dark-bg) 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite linear; border-radius: 8px; opacity: 0.7; }
.skeleton.sk-image { width: 100%; height: 150px; }
.skeleton.sk-title { width: 70%; height: 24px; margin-top: var(--space-lg); }
.skeleton.sk-stats { display:flex; justify-content: space-around; margin-top: var(--space-lg); gap: var(--space-md); }
.skeleton.sk-stat-item { width: 28%; height: 40px; }
.skeleton.sk-tab { width: 100%; height: 45px; margin-top: var(--space-lg); }

/* Scrollbar */
.hub-panel::-webkit-scrollbar { width: 8px; }
.hub-panel::-webkit-scrollbar-track { background: transparent; }
.hub-panel::-webkit-scrollbar-thumb { background-color: var(--secondary-dark-bg); border-radius: 10px; border: 2px solid var(--primary-dark-bg); }
.hub-panel::-webkit-scrollbar-thumb:hover { background-color: var(--tertiary-dark-bg); }

/* Dark Overlay on Section */
#strategic-hub-section { position: relative; z-index: 1; }
#strategic-hub-section::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.10); z-index: -1; }


/* ========================================================= */
/* ====== MOBILE RESPONSSIVENESS (Max Width 767px)      ====== */
/* ========================================================= */
@media (max-width: 767px) {
    
    /* --- 1. تحويل اللوحة الجانبية إلى لوحة سفلية (Bottom Sheet) --- */
    .hub-panel {
        width: 100%;
        max-width: 100%;
        left: 0;
        top: auto;
        bottom: 0;
        transform: translateY(100%); 
        max-height: 85dvh;
        border-radius: 20px 20px 0 0;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .hub-panel.is-location-view {
        left: 0;
        transform: translateY(0);
    }
    
    /* --- 2. تعديل محتوى اللوحة ليتناسب مع العرض الجديد --- */
    .hub-panel .panel-content {
        padding: var(--space-md);
    }
    .card-header { height: 120px; }
    .card-title { font-size: 20px; }
    .card-tabs { margin-bottom: var(--space-md); }
    .tab-btn { font-size: 13px; padding: var(--space-sm); }
    .card-actions a { padding: 13px; font-size: 13px; }
    
    /* --- 3. تصغير حجم مؤشرات الخريطة --- */
    .hq-marker-image { width: 50px; height: 50px; border-width: 3px; border-radius: 14px; }
    .hq-marker-image::after { font-size: 16px; bottom: -6px; right: -6px; padding: 4px; border-width: 2px; }
    .project-marker-image { width: 40px; height: 40px; border-width: 2px; }
    
    /* تعديل التكبير للموبايل */
    .custom-marker-container.is-active { transform: scale(1.1); }
    
    /* تعديل حجم الخط للموبايل لاسم المشروع الشفاف */
    .marker-label {
        font-size: 13px;
        padding: 0 8px 0 6px; /* زيادة مسافة بسيطة من اليسار */
        margin-left: 0; 
    }
    
    /* --- 4. تعديل زر الإغلاق --- */
    #reset-panel-btn { top: var(--space-sm); right: var(--space-sm); width: 32px; height: 32px; font-size: 14px; }

    /* --- منع ظهور الفراغات السوداء في قسم الخدمات --- */
    .services-section .services-grid {
        background-color: #000;
    }
}