/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo h1 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 5px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 14px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: white;
    font-weight: 500;
}

.alert-success {
    background: #28a745;
}

.alert-error {
    background: #dc3545;
}

.alert-info {
    background: #17a2b8;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9em;
}

.tech-info {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 5px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
}

/* Enhanced Map Controls */
.map-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.search-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box, .find-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.search-box input, .find-controls input {
    min-width: 250px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
}

.map-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.layer-controls {
    display: flex;
    gap: 10px;
}

.btn-group {
    display: flex;
    gap: 5px;
}

.btn-group .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Measurement Modal */
.measurement-result {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

/* Heatmap button animation */
.btn.active.heatmap-active {
    animation: pulse 1.5s infinite;
}

/* Cluster styling */
.marker-cluster-small {
    background-color: rgba(102, 126, 234, 0.6) !important;
}
.marker-cluster-small div {
    background-color: rgba(102, 126, 234, 0.8) !important;
    color: white !important;
}

.marker-cluster-medium {
    background-color: rgba(241, 196, 15, 0.6) !important;
}
.marker-cluster-medium div {
    background-color: rgba(241, 196, 15, 0.8) !important;
    color: white !important;
}

.marker-cluster-large {
    background-color: rgba(231, 76, 60, 0.6) !important;
}
.marker-cluster-large div {
    background-color: rgba(231, 76, 60, 0.8) !important;
    color: white !important;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .map-controls {
        flex-direction: column;
    }
    
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box, .find-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input, .find-controls input {
        min-width: unset;
        width: 100%;
    }
    
    .map-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tool-group {
        justify-content: center;
    }
}

/* Tambahkan di bagian CSS */

/* Custom Dialog */
.custom-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.dialog-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.dialog-header h4 {
    margin: 0;
    color: #2c3e50;
}

.dialog-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
}

.dialog-close:hover {
    background: #e9ecef;
    color: #dc3545;
}

.dialog-body {
    padding: 20px;
}

.share-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.share-preview p {
    margin: 5px 0;
    color: #5d6d7e;
}

.share-preview strong {
    color: #2c3e50;
}

.share-link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-link-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.share-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #5d6d7e;
    font-size: 14px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.detail-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
    font-size: 0.9em;
    border-bottom: 2px solid #dee2e6;
}

.detail-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
}

.detail-table tr:hover {
    background-color: #f8f9fa;
}

.detail-table tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
    margin-top: 20px;
}

.no-data i {
    font-size: 2em;
    margin-bottom: 15px;
    color: #95a5a6;
}

.no-data p {
    margin: 5px 0;
}
