* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#map {
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Search Container Compact tanpa card */
.search-container {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.search-input {
    background: #d8d8d8;
    border: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
    padding: 12px 56px 12px 20px;
    border-radius: 30px;
    width: 320px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    color: #333;
}

.search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
    font-size: 14px;
}

.search-input:focus {
    background: #e6f5ff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.12);
    width: 360px;
}

.search-btn {
    position: absolute;
    right: 8px;
    background: linear-gradient(135deg, #66b3ff 0%, #818385 100%);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(51, 153, 255, 0.4);
}

.search-btn:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 4px 12px rgba(51, 153, 255, 0.6);
}

.search-btn svg {
    width: 20px;
    height: 20px;
}

/* Search Results */
.search-results {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    max-height: 350px;
    overflow-y: auto;
    width: 350px;
    max-width: 90%;
    display: none;
    padding: 8px;
}

.search-results.active {
    display: block;
}

.result-item {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    margin-bottom: 4px;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.3);
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.result-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 3px;
    color: #333;
}

.result-subtitle {
    font-size: 12px;
    opacity: 0.8;
    color: #555;
}

/* Legend Items (inside layer control) */
.legend-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #333;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Layer Control Panel */
.layer-control {
    position: fixed;
    right: 15px;
    top: 15px;
    z-index: 999;
    padding: 10px;
    max-width: 200px;
    display: none;
}

.layer-control.active {
    display: block;
}

.layer-control-title {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.layer-control-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.layer-control-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.layer-name {
    font-size: 12px;
    color: #333;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2);
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* Google Maps style marker */
.google-maps-marker {
    background: #4285F4;
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.google-maps-marker::after {
    content: '';
    background: white;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: rotate(45deg);
}

/* Marker label */
.pancang-label {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    background: rgba(255,255,255,0.9);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    margin-top: 2px;
}

/* Remove default Leaflet icon styles for custom markers */
.custom-marker-container {
    background: transparent;
    border: none;
}



.dock {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.dock-item {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.dock-item:hover {
    transform: translateY(-8px) scale(1.08);
    background: rgba(255, 255, 255, 0.8);
}

.dock-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dock-item svg {
    width: 20px;
    height: 20px;
}

.dock-tooltip {
    position: absolute;
    bottom: 50px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.dock-item:hover .dock-tooltip {
    opacity: 1;
}

/* Info Popup */
.info-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
    padding: 18px;
    width: 90%;
    max-width: 420px;
    display: none;
}

.info-popup.active {
    display: block;
}

.info-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.info-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.close-popup {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

.close-popup:hover {
    opacity: 1;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 10px;
}

.info-label {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 4px;
    color: #555;
}

.info-value {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

@media (max-width: 768px) {
    /* Search Mobile Compact */
    .search-container {
        top: 10px;
    }
    .search-input {
        width: 200px;
        padding: 6px 40px 6px 12px;
        font-size: 12px;
    }
    .search-input:focus {
        width: 230px;
    }
    .search-btn {
        width: 32px;
        height: 32px;
        right: 5px;
    }
    .search-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Legend Items Mobile */
    .legend-item {
        font-size: 11px;
        gap: 6px;
    }
    .legend-color {
        width: 14px;
        height: 14px;
    }

    /* Layer Control Mobile */
    .layer-control {
        right: 8px;
        padding: 8px;
        max-width: 180px;
    }
    .layer-control-title {
        font-size: 11px;
        margin-bottom: 6px;
    }
    .layer-name {
        font-size: 11px;
    }
    .toggle-switch {
        width: 36px;
        height: 20px;
    }
    .toggle-slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(16px);
    }
    
    /* Dock Mobile */
    .dock {
        bottom: 10px;
        padding: 6px 10px;
        gap: 6px;
    }
    .dock-item {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .dock-item svg {
        width: 18px;
        height: 18px;
    }
    .dock-tooltip {
        bottom: 45px;
        font-size: 10px;
        padding: 3px 8px;
    }
    
    /* Info Popup Mobile */
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Lahan Table Container */
.lahan-table-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    padding: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 50vh;
    display: none;
    flex-direction: column;
    background: rgba(245, 245, 245, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 200, 200, 0.5);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

.lahan-table-container.active {
    display: flex;
}

.lahan-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

.lahan-table-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.lahan-table-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lahan-table-search {
    background: #fff;
    border: 1px solid #ccc;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
    color: #333;
}

.lahan-table-search:focus {
    border-color: #888;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.lahan-table-count {
    font-size: 12px;
    color: #666;
}

.lahan-table-minmax {
    background: none;
    border: none;
    color: #666;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lahan-table-minmax:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.lahan-table-minmax svg {
    width: 18px;
    height: 18px;
}

.lahan-table-wrapper {
    overflow-y: auto;
    flex: 1;
}

.lahan-table-container.minimized .lahan-table-wrapper {
    display: none;
}

.lahan-table-container.minimized {
    max-height: none;
    padding: 10px 12px;
}

.lahan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.lahan-table thead th {
    background: #e0e0e0;
    padding: 8px;
    text-align: left;
    position: sticky;
    top: 0;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #999;
}

.lahan-table tbody tr {
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.lahan-table tbody tr:nth-child(even) {
    background: #f5f5f5;
}

.lahan-table tbody tr:hover {
    background: #e8e8e8;
}

.lahan-table tbody td {
    padding: 6px 8px;
    color: #333;
}

.locate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.locate-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.locate-btn svg {
    width: 16px;
    height: 16px;
}
