/* ================ VARIABLES ================ */
:root {
    /* Colors */
    --primary-color: #4285F4;
    --primary-dark: #3367D6;
    --primary-light: #E8F0FE;
    --secondary-color: #34A853;
    --danger-color: #EA4335;
    --warning-color: #FBBC05;
    --dark-color: #202124;
    --gray-dark: #5F6368;
    --gray-medium: #9AA0A6;
    --gray-light: #DADCE0;
    --gray-extra-light: #F1F3F4;
    --white: #FFFFFF;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.302), 0 4px 8px 3px rgba(60,64,67,0.149);
    --shadow-lg: 0 2px 6px 2px rgba(60,64,67,0.302), 0 4px 8px 3px rgba(60,64,67,0.149);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-circle: 50%;

    /* Transitions */
    --transition-fast: 0.15s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;

    /* Layout */
    --leaflet-app-height: 100vh;
    --leaflet-navbar-height: 60px;
    --leaflet-statusbar-height: 40px;
    --leaflet-shell-offset: 100px;
}

/* ================ BASE STYLES ================ */
/* Container utama peta */
.leaflet-container {
    position: relative;
    width: 100%;
    height: var(--leaflet-app-height);
    min-height: var(--leaflet-app-height);
    display: flex;
    flex-direction: column;
    background: #e5e3df;
    overflow: hidden;
}

/* Navbar atas */
/* ================ BASE STYLES ================ */
.leaflet-navbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  max-width: 800px;
  height: var(--leaflet-navbar-height);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  z-index: 1000;
  transition: all var(--transition-medium) ease;
}

.leaflet-brand {
  display: flex;
  align-items: center;
  margin-right: var(--space-lg);
}

.brand-logo {
  height: 32px;
  width: auto;
  margin-right: var(--space-sm);
}

.brand-text {
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  font-weight: 500;
  color: var(--dark-color);
}

.leaflet-user-controls {
  display: flex;
  align-items: center;
}

/* Map Container */
.leaflet-map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--leaflet-app-height);
    z-index: 1;
}

/* Tab Panes */
.tab-pane-container {
    position: absolute;
    top: var(--leaflet-shell-offset);
    right: 60px;
    width: 350px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    z-index: 10;
    display: none;
    max-height: calc(var(--leaflet-app-height) - var(--leaflet-shell-offset) - var(--leaflet-statusbar-height) - 16px);
    overflow-y: auto;
}

.tab-pane-container.active {
    display: block;
}

.layer-section {
    margin-bottom: var(--space-lg);
}

.layer-section h4, .layer-section h5 {
    margin: 0 0 var(--space-md) 0;
    color: var(--dark-color);
}

.layer-section h5 {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--gray-dark);
}

.layer-options {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.layer-option {
    flex: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-light);
    transition: all var(--transition-fast);
}

.layer-option:hover {
    border-color: var(--gray-medium);
}

.layer-option.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.layer-option img {
    width: 100%;
    height: 60px;
    object-fit: cover;
}

.layer-option span {
    display: block;
    text-align: center;
    padding: var(--space-xs) 0;
    font-size: 12px;
}

.layer-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.layer-item {
    display: flex;
    align-items: center;
}

.layer-item input[type="checkbox"] {
    margin-right: var(--space-sm);
}

.layer-item label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 14px;
}

.layer-item i {
    color: var(--gray-medium);
    width: 20px;
    text-align: center;
}

/* Sidebar Tools */
.leaflet-sidebar {
    position: absolute;
    top: var(--leaflet-shell-offset);
    right: 10px;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 10;
}

.leaflet-sidebar.right {
    right: 10px;
    left: auto;
}

.sidebar-tabs {
    display: flex;
    flex-direction: column;
}

.tool-separator {
    height: 1px;
    background-color: var(--gray-light);
    margin: var(--space-xs) 0;
}

.tab-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-dark);
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--gray-extra-light);
}

.tab-btn.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

/* ================ TOOL BUTTON STATES ================ */
.tool-btn {
    /* Base styles remain the same */
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-dark);
    transition: all var(--transition-fast);
    position: relative;
    border-radius: var(--radius-sm);
}

/* INACTIVE STATE (Default) */
.tool-btn:not(.active) {
    background-color: var(--white);
    color: var(--gray-dark);
}

/* HOVER STATE */
.tool-btn:hover:not(.disabled) {
    background-color: var(--gray-extra-light);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* ACTIVE STATE (On) */
.tool-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* Active hover */
.tool-btn.active:hover {
    background-color: var(--primary-light);
    filter: brightness(0.95);
}

/* DISABLED STATE (Off) */
.tool-btn.disabled {
    background-color: var(--gray-extra-light);
    color: var(--gray-light);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Icon transitions */
.tool-btn i {
    transition: transform var(--transition-fast);
}

.tool-btn.active i {
    transform: scale(1.1);
}

/* Status Bar */
.leaflet-statusbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--leaflet-statusbar-height);
    background-color: var(--white);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    z-index: 10;
    font-size: 12px;
    color: var(--gray-dark);
}

.status-section {
    display: flex;
    align-items: center;
    margin-right: var(--space-lg);
}

.status-section i {
    margin-right: var(--space-xs);
}

.coordinates {
    font-family: monospace;
}

.copyright {
    margin-left: auto;
}

/* Street View */
.streetview-container {
    position: absolute;
    top: var(--leaflet-navbar-height);
    bottom: var(--leaflet-statusbar-height);
    left: 0;
    right: 0;
    background-color: var(--white);
    z-index: 2000;
    display: none;
}

.streetview-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--leaflet-navbar-height);
    background-color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    z-index: 2001;
    box-shadow: var(--shadow-sm);
}

.streetview-pano {
    position: absolute;
    top: var(--leaflet-navbar-height);
    bottom: 0;
    left: 0;
    right: 0;
}

.btn-close-streetview {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-dark);
    margin-right: var(--space-md);
    transition: background-color var(--transition-fast);
}

.btn-close-streetview:hover {
    background-color: var(--gray-extra-light);
}

/* Measure Tools */
.measure-tools-container {
    position: absolute;
    top: var(--leaflet-shell-offset);
    left: 10px;
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-sm);
    z-index: 10;
}
