/* ==========================================
   1. تنسيق الصفحة الرئيسي
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');
   .map-page-container {
    max-width: 1400px;
    width: 95%;
    margin: 2rem auto;
    padding: 0 1rem;
}

.map-header {
    text-align: right;
    margin-bottom: 2rem;
}

.page-title {
    font-family: 'Amiri', serif;
    font-size: 34px;
    color: #f4ede2;
    margin-bottom: 8px;
}

.page-desc {
    font-family: 'Amiri', serif;
    font-size: 18px;
    color: #b8afa4;
}

/* ==========================================
   2. أدوات البحث والأزرار
   ========================================== */
.map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.map-search-input {
    flex: 1;
    min-width: 280px;
    padding: 12px 18px;
    background-color: #28221d;
    border: 1px solid #433830;
    border-radius: 8px;
    color: #f4ede2;
    font-family: 'Amiri', serif;
    font-size: 16px;
    outline: none;
}

.map-search-input:focus {
    border-color: #d4a373;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #28221d;
    border: 1px solid #433830;
    color: #b8afa4;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Amiri', serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover, 
.filter-btn.active {
    background-color: #332b25;
    color: #f4ede2;
    border-color: #d4a373;
}

/* ==========================================
   3. تخطيط العرض الرئيسي (خريطة + كروت بجانب بعض)
   ========================================== */
.map-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: 620px;
    align-items: stretch;
}

.map-view-box {
    flex: 2.2;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #433830;
    height: 100%;
    background-color: #1c1815;
    position: relative;
}

/* ==========================================
   4. حاوية الصورة والتمرير التفاعلي وأدوات التكبير
   ========================================== */
.map-image-scroll-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 10px;
    box-sizing: border-box;
    position: relative;
    cursor: grab;
    scroll-behavior: smooth;
}

.map-image-scroll-wrapper:active {
    cursor: grabbing;
}

.map-notice-bar {
    font-family: 'Amiri', serif;
    font-size: 13px;
    color: #b8afa4;
    background-color: rgba(28, 24, 21, 0.95);
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: center;
    position: sticky;
    top: 0;
    right: 0;
    z-index: 10;
    border: 1px solid #433830;
    backdrop-filter: blur(4px);
}

.long-map-img {
    width: 2000px;
    max-width: none;
    height: auto;
    display: block;
    border-radius: 6px;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: 0 0;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.zoom-controls button {
    background-color: #28221d;
    color: #f4ede2;
    border: 1px solid #433830;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-controls button:hover {
    background-color: #d4a373;
    border-color: #d4a373;
    color: #1c1815;
}

/* ==========================================
   5. قائمة المباني والكروت
   ========================================== */
.buildings-list {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-left: 5px;
    height: 100%;
}

.building-card {
    background-color: #28221d;
    border: 1px solid #433830;
    padding: 16px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.building-card:hover {
    background-color: #332b25;
    border-color: #d4a373;
}

.building-card h3 {
    font-family: 'Amiri', serif;
    font-size: 18px;
    color: #f4ede2;
    margin-bottom: 6px;
}

.building-card p {
    font-family: 'Amiri', serif;
    font-size: 14px;
    color: #b8afa4;
    line-height: 1.5;
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.locate-on-map-btn {
    background-color: #332b25;
    color: #d4a373;
    border: 1px solid #433830;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Amiri', serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.locate-on-map-btn:hover {
    background-color: #d4a373;
    color: #1c1815;
    border-color: #d4a373;
}

.direct-map-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #b8afa4;
    font-family: 'Amiri', serif;
    transition: color 0.2s ease;
    padding: 6px 0;
}

.direct-map-btn:hover {
    color: #d4a373;
    text-decoration: underline;
}

/* ==========================================
   6. أشرطة التمرير الناعمة
   ========================================== */
.buildings-list::-webkit-scrollbar,
.map-image-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.buildings-list::-webkit-scrollbar-track,
.map-image-scroll-wrapper::-webkit-scrollbar-track {
    background: #1c1815;
}

.buildings-list::-webkit-scrollbar-thumb,
.map-image-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #433830;
    border-radius: 4px;
}

.buildings-list::-webkit-scrollbar-thumb:hover,
.map-image-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #d4a373;
}

/* ==========================================
   7. التجاوب مع الشاشات الصغيرة (الهواتف)
   ========================================== */
@media (max-width: 900px) {
    .map-layout {
        flex-direction: column;
        height: auto;
    }
    .map-view-box {
        height: 380px;
    }
    .buildings-list {
        height: 420px;
    }
}

.map-container {
  overflow: hidden;
  touch-action: none;   /* بيخلي الكود يتحكم باللمس */
  -webkit-user-select: none;
  user-select: none;
}
.map-container img {
  max-width: none;
  will-change: transform;
  -webkit-user-drag: none;
}