body { margin:0; font-family:Segoe UI; }

/* HEADER */
.header {
    height:60px;
    background:#0f6b63;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 20px;
    color:white;
}

.logo {
    display:flex;
    align-items:center;
    font-size:18px;
    font-weight:600;
}

.logo img {
    height:40px;
    margin-right:10px;
}

.menu {
    display:flex;
    gap:15px;
}

.menu button {
    background:none;
    border:1px solid rgba(255,255,255,0.3);
    color:white;
    padding:6px 12px;
    border-radius:6px;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:6px;
}

.menu button:hover {
    background:rgba(255,255,255,0.2);
}

#map {
    position:absolute;
    top:60px;
    bottom:0;
    width:100%;
}

/* PANEL */
.panel {
    position:absolute;
    top:70px;
    right:20px;
    width:340px;
    background:white;
    border-radius:10px;
    box-shadow:0 6px 18px rgba(0,0,0,0.3);
    padding:15px;
    display:none;
    z-index:1000;
    max-height:75%;
    overflow:auto;
}

.panel h3 {
    display:flex;
    justify-content:space-between;
    margin-top:0;
}

/* Basemap grid */
.basemap-grid {
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap:15px;
}

.basemap-card {
    text-align:center;
    cursor:pointer;
    padding:5px;
    border-radius:8px;
    transition:0.3s;
}

.basemap-card img {
    width:100%;
    height:80px;
    object-fit:cover;
    border-radius:8px;
    border:2px solid transparent;
}

.basemap-card.active img {
    border:2px solid #0f6b63;
}

.basemap-card:hover {
    background:#f2f2f2;
}

.legend-item {
    display:flex;
    align-items:center;
    margin-bottom:8px;
}

.legend-color {
    width:18px;
    height:18px;
    margin-right:8px;
}

/* Print */
@media print {
    .header, .panel { display:none; }
    #map { top:0; }
}
.layer-section {
    margin-bottom:15px;
    border-radius:6px;
    overflow:hidden;
    border:1px solid #ddd;
}

.section-title {
    padding:10px 12px;
    font-weight:600;
    color:white;
    cursor:pointer;
}

.section-title.teal {
    background:#33a6b8;
}

.section-title.blue {
    background:#1f6ad9;
}

.section-body {
    background:#f7f7f7;
    padding:10px 12px;
}

.section-body label {
    display:block;
    margin-bottom:8px;
    font-size:14px;
}
.attribute-panel {
    position:absolute;
    top:120px;
    left:50px;
    width:350px;
    background:white;
    border-radius:8px;
    box-shadow:0 8px 20px rgba(0,0,0,0.3);
    display:none;
    z-index:2000;
    overflow:hidden;
    font-family:Segoe UI;
}

.attr-header {
    background:#2ea7b0;
    color:white;
    padding:10px 15px;
    font-weight:600;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.close-btn {
    cursor:pointer;
    font-size:16px;
}

.attr-body {
    padding:15px;
    background:#f5f5f5;
}

.attr-title {
    font-weight:700;
    margin-bottom:10px;
    color:#333;
}

#attrTable {
    width:100%;
    border-collapse:collapse;
    font-size:14px;
}

#attrTable td {
    border:1px solid #ccc;
    padding:6px 8px;
}

#attrTable td:first-child {
    font-weight:600;
    width:45%;
    background:#eaeaea;
}
.measure-panel {
    position:absolute;
    top:100px;
    right:40px;
    width:360px;
    background:white;
    border-radius:8px;
    box-shadow:0 8px 20px rgba(0,0,0,0.3);
    z-index:3000;
    display:none;
    font-family:Segoe UI;
}

.measure-header {
    background:#e5e5e5;
    padding:10px 15px;
    font-weight:600;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.measure-tabs {
    display:flex;
    border-bottom:1px solid #ddd;
}

.measure-tabs button {
    flex:1;
    padding:8px;
    border:none;
    background:#f5f5f5;
    cursor:pointer;
}

.measure-tabs button.active {
    background:white;
    border-bottom:2px solid #0f6b63;
}

.measure-body {
    padding:15px;
}

.measure-result {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:10px;
}

.measure-result span {
    font-size:18px;
    font-weight:600;
}

.measure-result select {
    padding:4px;
}
/* LEGEND SLIDE PANEL */
.legend-slide {
    position:absolute;
    bottom:20px;
    left:-320px;   /* Hidden position */
    width:280px;
    background:white;
    border-radius:10px;
    box-shadow:0 6px 20px rgba(0,0,0,0.3);
    z-index:2000;
    transition:all 0.4s ease;
    overflow:hidden;
}

.legend-slide.active {
    left:20px;   /* Slide into view */
}

.legend-header {
    background:#0f6b63;
    color:white;
    padding:10px 15px;
    font-weight:600;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.legend-body {
    padding:12px;
}

.legend-item {
    display:flex;
    align-items:center;
    margin-bottom:8px;
    font-size:14px;
}

.legend-color {
    width:18px;
    height:18px;
    margin-right:10px;
    border-radius:4px;
}
.print-panel {
    position:absolute;
    top:100px;
    left:50%;
    transform:translateX(-50%);
    width:350px;
    background:white;
    border-radius:10px;
    box-shadow:0 10px 25px rgba(0,0,0,0.3);
    z-index:4000;
    display:none;
    font-family:Segoe UI;
}

.print-header {
    background:#6b8e23;
    color:white;
    padding:10px 15px;
    font-weight:600;
    display:flex;
    justify-content:space-between;
}

.print-body {
    padding:15px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.print-body input,
.print-body select {
    padding:6px;
}