/* style.css - STYLING UTAMA LENGKAP DAN RESPONSIF */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #95a5a6;
    --secondary-dark: #7f8c8d;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

header h1 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.8em;
    font-weight: 700;
}

header p {
    color: var(--text-light);
    font-size: 1em;
    font-weight: 400;
}

/* Search Section */
.search-section {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Tab Styles */
.search-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    min-width: 180px;
}

.tab-button:hover {
    color: var(--text-dark);
    background-color: #f8f9fa;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    align-items: end;
}

.form-group {
    position: relative;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9em;
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input[type="text"]:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

.input-hint {
    font-size: 0.75em;
    color: var(--text-light);
    margin-top: 5px;
    font-style: italic;
}

/* Coordinate Examples */
.coordinate-examples {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.coordinate-examples strong {
    display: block;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 0.9em;
}

.example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.example-btn {
    background: var(--white);
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.8em;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.example-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
}

/* Suggestions */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.error {
    color: var(--error-color);
    font-style: italic;
    background-color: #fdf2f2;
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.button-group.full-width {
    grid-column: 1 / -1;
}

.btn-primary, .btn-secondary, .btn-success, .btn-info {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    flex: 1;
    min-width: 150px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

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

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading {
    display: none;
}

/* Map Controls */
.map-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    gap: 15px;
    flex-wrap: wrap;
}

.map-type-toggle {
    display: flex;
    gap: 8px;
}

.btn-map-type {
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    background: var(--white);
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85em;
    font-weight: 600;
}

.btn-map-type.active {
    background: var(--primary-color);
    color: var(--white);
}

.btn-map-type:hover:not(.active) {
    background: #e3f2fd;
}

.coverage-info {
    font-weight: 600;
    font-size: 0.95em;
    flex: 1;
    text-align: center;
}

.status-unknown { color: var(--text-light); }
.status-covered { color: var(--success-color); }
.status-not-covered { color: var(--error-color); }

/* Map Container */
.map-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    height: 450px;
}

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

/* Results Section */
.results-section {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.results-section h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
    font-size: 1.3em;
    font-weight: 600;
}

.odp-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid var(--primary-color);
}

.odp-info h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.odp-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.odp-detail {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: var(--white);
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.odp-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8em;
    margin-bottom: 5px;
}

.odp-value {
    color: var(--text-dark);
    font-size: 0.9em;
}

/* Status Badges */
.status-yes, .status-no, .status-unknown {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
}

.status-yes {
    background: var(--success-color);
    color: var(--white);
}

.status-no {
    background: var(--error-color);
    color: var(--white);
}

.status-unknown {
    background: var(--secondary-color);
    color: var(--white);
}

/* Message Styles */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

.message-content {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    font-size: 0.95em;
    font-weight: 500;
}

.success-message .message-content {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error-message .message-content {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.warning-message .message-content {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.info-message .message-content {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.message-icon {
    margin-right: 10px;
    font-size: 18px;
}

.message-text {
    flex: 1;
}

.message-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

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

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Result Messages */
.success-message, .warning-message, .error-message, .info-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.info-message {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Marker Styles */
.user-marker {
    background: none;
    border: none;
}

/* Popup Styles */
.user-popup, .odp-popup {
    min-width: 250px;
    font-size: 0.9em;
}

.odp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.odp-header h4 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1em;
    font-weight: 600;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
}

.detail-row {
    display: flex;
    margin-bottom: 6px;
    font-size: 0.85em;
}

.detail-row .label {
    font-weight: 600;
    color: var(--text-light);
    min-width: 100px;
}

.detail-row .value {
    color: var(--text-dark);
    flex: 1;
}

.detail-row .value.covered {
    color: var(--success-color);
    font-weight: 600;
}

.detail-row .value.not-covered {
    color: var(--error-color);
    font-weight: 600;
}

/* Coverage Action Section */
.coverage-action-covered,
.coverage-action-not-covered {
    padding: 25px;
    border-radius: var(--radius);
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.coverage-action-covered {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.coverage-action-not-covered {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.coverage-action-covered h4,
.coverage-action-not-covered h4 {
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    min-width: 200px;
    font-family: inherit;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Copy Button */
.btn-copy {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: var(--secondary-dark);
}

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

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .search-section {
        padding: 15px;
    }
    
    .search-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        padding: 12px;
        font-size: 13px;
        min-width: auto;
    }
    
    .search-form {
        grid-template-columns: 1fr;
    }
    
    .map-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .map-type-toggle {
        justify-content: center;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn-primary,
    .button-group .btn-secondary {
        min-width: auto;
    }
    
    .map-container {
        height: 350px;
    }
    
    .message-container {
        left: 10px;
        right: 10px;
        min-width: auto;
        top: 10px;
    }
    
    .coverage-info {
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-action {
        min-width: auto;
    }
    
    .example-list {
        flex-direction: column;
    }
    
    .odp-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    header {
        padding: 12px;
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    header p {
        font-size: 0.9em;
    }
    
    .search-section {
        padding: 12px;
    }
    
    .results-section {
        padding: 15px;
    }
    
    .map-container {
        height: 300px;
    }
    
    .coverage-action-covered,
    .coverage-action-not-covered {
        padding: 15px;
    }
    
    .btn-action {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .message-content {
        padding: 12px;
        font-size: 0.9em;
    }
}

/* Ensure map container has proper height */
.leaflet-container {
    height: 100%;
    width: 100%;
}

/* Coverage circle style */
.leaflet-interactive {
    stroke-width: 2;
}