/* ===================================================
   GHEZLAR WEBGIS – PRODUCTION STYLESHEET (VERSION 2.9)
   INTEGRATED WITH ADVANCED POPUPS & LIGHTBOX GALLERY
   =================================================== */

/* 1. GLOBAL PAGE SETTINGS */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

/* 2. FIXED TOP PROJECT HEADER */
#project-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    direction: ltr;
}

.header-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.header-center-text {
    flex: 1;
    text-align: center;
}

.header-center-text h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 700;
    color: #1f4e79;
}

.header-center-text p {
    font-size: 12px;
    margin: 4px 0 0 0;
    color: #555;
    line-height: 1.4;
}

/* 3. MAP CONTAINER SETUP (Accounts for 70px Header) */
#map {
    position: absolute;
    top: 70px;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

/* 4. ADVANCED POPUP CUSTOMIZATION */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 3px 14px rgba(0,0,0,0.3);
}

.leaflet-popup-content {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 !important;
    width: 280px !important;
}

/* Nice Scrollbar for Popup Content */
.leaflet-popup-content::-webkit-scrollbar {
    width: 6px;
}
.leaflet-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.leaflet-popup-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Popup Inner Elements */
.custom-popup {
    display: flex;
    flex-direction: column;
}

.popup-header {
    color: white;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.5px;
}

.popup-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.popup-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.popup-table td {
    padding: 8px 12px;
    font-size: 12px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.popup-table td.label {
    font-weight: bold;
    color: #555;
    width: 45%;
}

.popup-table td.value {
    word-break: break-all;
}

.popup-image {
    padding: 10px;
    text-align: center;
    background: #f5f5f5;
    border-top: 1px solid #eee;
}

.popup-image img {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.popup-image img:hover {
    transform: scale(1.02);
}

.popup-footer {
    padding: 10px 12px;
    background: #fafafa;
    text-align: center;
    border-top: 1px solid #eee;
}

.pdf-link {
    color: #e67e22;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    display: inline-block;
    transition: color 0.2s;
}

.pdf-link:hover {
    color: #d35400;
    text-decoration: underline;
}

/* 5. IMAGE LIGHTBOX GALLERY (MODAL) */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.lightbox img {
    max-width: 90%;
    max-height: 85%;
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(255,255,255,0.25);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 35px;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #e74c3c;
}

.lightbox-nav {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 20px;
}

.lightbox-nav button {
    font-size: 20px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: background 0.2s;
}

.lightbox-nav button:hover {
    background: #e0e0e0;
}

/* 6. MAP CONTROLS & UTILITIES */
.coordinates-control {
    background: rgba(255, 255, 255, 0.85);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 11px;
    font-family: monospace;
    font-weight: bold;
    color: #333;
    box-shadow: 0 1px 5px rgba(0,0,0,0.15);
}

/* Legend Control */
.legend {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 1px 5px rgba(0,0,0,0.15);
    line-height: 1.5;
    color: #333;
    max-width: 220px;
}

.legend h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
    color: #1f4e79;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 11px;
}

.legend-item i {
    width: 18px;
    height: 12px;
    margin-right: 8px;
    display: inline-block;
    flex-shrink: 0;
}