/* Map Container */
#map {
    height: 500px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.map-container {
    position: relative;
}

/* Map loading state */
.map-container.loading {
    pointer-events: none;
    cursor: wait !important;
}

.map-container.loading * {
    cursor: wait !important;
}

.map-container.loading #map {
    opacity: 0.7;
    filter: grayscale(30%);
}

.map-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    z-index: 1000;
    cursor: wait !important;
}

/* Disable search and buttons during loading */
.map-container.loading .geo-map-search-box,
.map-container.loading .location-button {
    opacity: 0.6;
    cursor: wait !important;
}

.map-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 400;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-instruction.visible {
    opacity: 1;
}

/* Custom Marker - Fixed alignment */
.custom-marker {
    position: relative;
    width: 15px !important;
    height: 15px !important;
    display: block;
}

.marker-pin {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #ff6725;
    border: 2px solid white;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    background-color: rgba(255, 103, 37, 0.3);
    animation: pulse 2s infinite;
    z-index: 1;
}

.custom-marker.current-location .marker-pin {
    background-color: #FF6725;
}

.custom-marker.current-location .marker-pulse {
    background-color: rgba(255, 103, 37, 0.3);
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Location Button */
.location-button {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 18px;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    cursor: url(../dashboard/images/icon/pointer.svg), auto !important;
    margin-bottom: 10px;
}

.location-button:hover {
    background-color: #ff6725;
    color: #fff;
}

.location-button.active {
    background-color: #ff6725;
    color: #fff;
}

/* Search Container */
.geo-map-search-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    width: calc(100% - 100px);
    max-width: 400px;
}

.geo-map-search-box {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 14px;
}

.geo-map-search-box:focus {
    outline: 2px solid rgba(255, 103, 37, 0.5);
    box-shadow: 0 0 3px 3px rgba(255, 103, 37, 0.25);
}

.geo-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1001;
}

.geo-search-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: url(../dashboard/images/icon/pointer.svg), auto !important;
    transition: background-color 0.2s ease;
}

.geo-search-result-item:hover {
    background-color: rgba(255, 103, 37, 0.1);
}

.geo-search-result-name {
    font-size: 14px;
    color: #333;
}

/* Map Controls */
.map-controls-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Loader - Fixed positioning */
.loader {
    display: none;
    text-align: center;
    padding: 30px 40px;
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 320px;
}

.loader .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #ff6725;
}

.loader p {
    color: #333;
}

.loader .text-muted {
    color: #6c757d !important;
}

/* Result Card */
.result-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    display: none;
    background-color: #fff;
}

.result-card .card-header {
    background: linear-gradient(135deg, #ff6725 0%, #e55b1e 100%);
    color: white;
    padding: 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card .card-body {
    padding: 0;
}

#closeResult {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 8px;
    padding: 6px 12px;
    transition: all 0.3s ease;
}

#closeResult:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Raw Data Section */
.raw-data-section {
    padding: 25px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.data-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.data-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-right: 15px;
}

.data-title {
    flex: 1;
}

.data-title h5 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.data-title p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.data-item {
    background: white;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.data-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.data-item-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 20px;
}

.data-item-content {
    flex: 1;
}

.data-item-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 3px;
    font-weight: 500;
}

.data-item-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Analysis Section */
.analysis-section {
    padding: 25px;
    background-color: #fff;
}

.analysis-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.analysis-header h5 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.analysis-header i {
    margin-right: 10px;
    color: #ff6725;
    font-size: 24px;
}

#analysisLoader {
    text-align: center;
    padding: 40px;
}

#analysisContent {
    line-height: 1.8;
    color: #333;
}

/* AI Analysis Content Styling */
#analysisContent h1,
#analysisContent h2,
#analysisContent h3,
#analysisContent h4,
#analysisContent h5,
#analysisContent h6 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 15px;
}

#analysisContent h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid #ff6725;
    padding-bottom: 10px;
}
#analysisContent h3{
    font-size: 24px;
}

#analysisContent ul,
#analysisContent ol {
    padding-left: 25px;
    margin-bottom: 15px;
}

#analysisContent li {
    margin-bottom: 8px;
}

#analysisContent .alert {
    border-radius: 8px;
    margin: 15px 0;
}

#analysisContent .text-success {
    color: #28a745 !important;
}

#analysisContent .text-warning {
    color: #ffc107 !important;
}

#analysisContent .text-danger {
    color: #dc3545 !important;
}

#analysisContent .text-info {
    color: #17a2b8 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .data-grid {
        grid-template-columns: 1fr;
    }

    .geo-map-search-container {
        width: calc(100% - 60px);
    }

    .map-instruction {
        font-size: 14px;
        padding: 10px 20px;
    }
}

/* Leaflet Override */
.leaflet-grab {
    cursor: url(../dashboard/images/icon/pointer.svg), auto !important;
}

/* Ensure proper z-index hierarchy */
.leaflet-pane {
    z-index: 1;
}

.leaflet-control-container {
    z-index: 800;
}

/* Utility Classes */
.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.px-3 {
    padding-left: 1rem;
    padding-right: 1rem;
}
