/* ================================
   Global page settings
================================ */
html, body{
    height:100%;
    margin:0;
    padding:0;
    font-family:Arial, sans-serif;
}

/* ================================
   Fixed top project header
================================ */
#project-header{
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:70px;

    background:#ffffffcc;
    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 logos
================================ */
.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
================================ */
.header-center-text{
    flex:1 1 auto;
    text-align:center;
    padding:0 10px;
}

.header-center-text h1{
    font-size:18px;
    margin:0;
    font-weight:700;
}

.header-center-text p{
    font-size:12px;
    margin:2px 0 0 0;
    line-height:1.4;
}

/* ================================
   Leaflet map container
================================ */
#map{
    margin-top:70px;
    height:calc(100vh - 70px);
    width:100%;
}

/* ================================
   Popup base style
================================ */
.leaflet-popup-content{
    font-size:14px;
}

/* ================================
   Custom popup styling
================================ */
.custom-popup{
    font-family:Arial, sans-serif;
    font-size:13px;
    min-width:220px;
}

.custom-popup .popup-header{
    color:#fff;
    font-weight:bold;
    padding:6px 8px;
    border-radius:4px 4px 0 0;
}

.custom-popup .popup-table{
    border-collapse:collapse;
    width:100%;
    background:#fff;
}

.custom-popup .popup-table td{
    border:1px solid #eee;
    padding:4px 6px;
}

.custom-popup .popup-table td.label{
    font-weight:bold;
    background:#f8f8f8;
    width:40%;
}

.custom-popup .popup-table td.value{
    width:60%;
}

.custom-popup .popup-footer{
    padding:5px 6px;
    background:#fafafa;
    font-size:12px;
    text-align:right;
}

.custom-popup .pdf-link{
    text-decoration:none;
    color:#0066cc;
}

.custom-popup .pdf-link:hover{
    text-decoration:underline;
}

/* ================================
   Popup image
================================ */
.popup-image{
    width:100%;
    text-align:center;
    margin-top:8px;
}

.popup-image img{
    max-width:100%;
    max-height:180px;
    width:auto;
    height:auto;
    object-fit:contain;

    border-radius:6px;
    border:1px solid #ddd;
    background:#fff;

    display:inline-block;
    cursor:zoom-in;
}

/* ================================
   Popup video (ADDED FIX)
================================ */
.popup-video{
    width:100%;
    text-align:center;
    margin-top:10px;
}

.popup-video video{
    width:100%;
    max-height:220px;
    border-radius:6px;
    border:1px solid #ddd;
    background:black;
}

/* ================================
   Legend styling
================================ */
.info.legend{
    background:#ffffffcc;
    padding:8px 10px;
    border-radius:4px;
    box-shadow:0 1px 4px rgba(0,0,0,0.3);
    font-size:12px;
    line-height:1.4;
}

.info.legend h4{
    margin:0 0 4px 0;
    font-size:13px;
    font-weight:bold;
}

.info.legend .legend-item{
    display:flex;
    align-items:center;
    margin-top:3px;
}

.info.legend .legend-item i{
    display:inline-block;
    margin-right:6px;
}

.info.legend .legend-item span{
    vertical-align:middle;
}

/* ================================
   Leaflet layer control
================================ */
.leaflet-control-layers{
    font-size:12px;
}

.leaflet-control-layers-toggle{
    background-image:url('https://unpkg.com/leaflet@1.9.4/dist/images/layers.png') !important;
    background-size:28px 28px;
    width:32px !important;
    height:32px !important;
    border-radius:4px;
}

.leaflet-retina .leaflet-control-layers-toggle{
    background-image:url('https://unpkg.com/leaflet@1.9.4/dist/images/layers-2x.png') !important;
}

/* ================================
   Lightbox gallery
================================ */
.lightbox{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.85);
    justify-content:center;
    align-items:center;
    z-index:99999;
}

.lightbox img{
    max-width:90%;
    max-height:85%;
    border-radius:8px;
    box-shadow:0 0 20px rgba(255,255,255,0.3);
}

.lightbox-close{
    position:absolute;
    top:20px;
    right:30px;
    font-size:28px;
    color:white;
    cursor:pointer;
}

.lightbox-nav{
    position:absolute;
    bottom:30px;
}

.lightbox-nav button{
    font-size:24px;
    padding:10px 18px;
    margin:0 10px;
    border:none;
    border-radius:6px;
    background:white;
    cursor:pointer;
}

/* ================================
   Popup scroll control
================================ */

.leaflet-popup-content{
    max-height:320px;      /* maximum popup height */
    overflow-y:auto;       /* enable vertical scroll */
    overflow-x:hidden;
    padding-right:6px;     /* space for scrollbar */
}

/* Optional: nicer scrollbar */
.leaflet-popup-content::-webkit-scrollbar{
    width:6px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb{
    background:#bbb;
    border-radius:4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover{
    background:#888;
}

.coordinates-control {
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    font-family: Arial, sans-serif;
}


/* ================================
   Optional: move Leaflet controls
================================ */
/*
.leaflet-top.leaflet-left{
    top:90px;
}
*/