/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* HEADER */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
}

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

.logo {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.btn-dashboard {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 25px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-dashboard:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* MAIN CONTAINER */
.container {
    display: flex;
    height: calc(100vh - 80px);
    margin-top: 80px;
    background: white;
}

.dashboard-container {
    display: flex;
    height: calc(100vh - 80px);
    margin-top: 80px;
    background: white;
}

/* FORM PANEL */
.form-panel {
    width: 40%;
    padding: 2rem;
    overflow-y: auto;
    background: white;
    border-right: 1px solid #e0e0e0;
}

.form-panel h2 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.form-panel p {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* FORM STYLES */
.lokasiForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    width: 100%;
}

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

.form-group input[type="file"] {
    border: 2px dashed #e0e0e0;
    background: #f9f9f9;
    cursor: pointer;
}

.coord-note {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
    font-style: italic;
}

.form-group button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.form-group button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* MAP PANEL */
.map-panel {
    flex: 1;
    position: relative;
    background: #f0f0f0;
}

#map {
    width: 100%;
    height: 100%;
}

.locate-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.locate-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* IMAGE PREVIEW */
#imagePreviewContainer {
    margin-top: 1rem;
}

#imagePreview {
    max-width: 100%;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 0.5rem;
}

#removeImage {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

#removeImage:hover {
    background: #c82333;
}

/* CONFIRMATION MODAL */
.konfirmasi {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.alert_box {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}

.alert_box .icon {
    text-align: center;
    margin-bottom: 1rem;
}

.alert_box .icon i {
    font-size: 3rem;
    color: #ffc107;
}

.alert_box .isi {
    text-align: center;
    margin-bottom: 1.5rem;
}

.alert_box .isi header {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.alert_box .isi p {
    color: #666;
}

.btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btns button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#confirm {
    background: #28a745;
    color: white;
}

#confirm:hover {
    background: #218838;
}

#cancel {
    background: #6c757d;
    color: white;
}

#cancel:hover {
    background: #5a6268;
}

/* DASHBOARD STYLES */
.map-section {
    flex: 1;
    position: relative;
}

.sidebar-section {
    width: 400px;
    padding: 2rem;
    overflow-y: auto;
    background: white;
    border-left: 1px solid #e0e0e0;
}

.stats-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 2rem;
}

#stat-title {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-card.orange {
    background: rgba(255, 152, 0, 0.3);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.info-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    padding: 1.5rem;
}

.info-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

.attr-table {
    width: 100%;
    border-collapse: collapse;
}

.attr-table tr {
    border-bottom: 1px solid #f0f0f0;
}

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

.attr-table td {
    padding: 0.75rem 0;
    vertical-align: top;
}

.attr-table td:first-child {
    font-weight: 600;
    color: #333;
    width: 40%;
}

.attr-table td:last-child {
    color: #666;
}

.table-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.img-link {
    font-size: 0.8rem;
    color: #667eea;
    text-decoration: none;
}

.img-link:hover {
    text-decoration: underline;
}

/* POPUP STYLES */
.leaflet-popup-content {
    font-family: 'Poppins', sans-serif;
}

.popup-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.popup-info {
    font-size: 0.9rem;
    line-height: 1.5;
}

.popup-info strong {
    color: #333;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        padding: 1rem;
        height: auto;
        position: relative;
    }
    
    .container {
        flex-direction: column;
        height: auto;
        margin-top: 0;
    }
    
    .form-panel {
        width: 100%;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .map-panel {
        min-height: 400px;
    }
    
    .dashboard-container {
        flex-direction: column;
        height: auto;
        margin-top: 0;
    }
    
    .sidebar-section {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
    
    .main-nav {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0.75rem;
    }
    
    .form-panel {
        padding: 0.75rem;
    }
    
    .sidebar-section {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* LOADING SPINNER */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Data List Styles */
.data-list-section {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.data-list-item {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.data-list-item:hover {
    background: #f0f4ff;
    border-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

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

.data-list-item.active .location-time,
.data-list-item.active .location-kk {
    color: rgba(255,255,255,0.8);
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.location-title {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 1rem;
}

.data-list-item.active .location-title {
    color: white;
}

.location-time {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    margin-left: 1rem;
}

.location-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.location-kebutuhan {
    background: #e8f0fe;
    color: #1565c0;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    width: fit-content;
}

.data-list-item.active .location-kebutuhan {
    background: rgba(255,255,255,0.2);
    color: white;
}

.location-kk {
    font-size: 0.85rem;
    color: #666;
}

.location-contact {
    font-size: 0.85rem;
    color: #555;
    font-family: monospace;
}

.data-list-item.active .location-contact {
    color: rgba(255,255,255,0.9);
}

.list-loading {
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
