/**
 * Rahmah Maps Scraper
 * Map-specific styles
 */

/* Map container styling */
#map-container {
    width: 100%;
    height: 600px;
    border-radius: 16px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    z-index: 1;
    overflow: hidden;
    margin-bottom: 30px;
    border: 3px solid white;
}

/* Custom map controls */
.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
    z-index: 999;
}

/* Style the zoom controls */
.leaflet-control-zoom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    margin-top: 15px !important;
    margin-left: 15px !important;
}

.leaflet-control-zoom a {
    background-color: white !important;
    color: #4A5568 !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    transition: all 0.3s ease;
}

.leaflet-control-zoom a:hover {
    background-color: #F7FAFC !important;
    color: var(--primary-color) !important;
    transform: scale(1.05);
}

/* Scale control styling */
.leaflet-control-scale {
    margin-bottom: 15px !important;
    margin-left: 15px !important;
}

/* Custom marker styling */
.custom-marker {
    background: transparent;
    border: none;
}

/* The marker pin element */
.marker-pin {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    background: var(--primary-color);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -20px 0 0 -15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.marker-pin::after {
    content: '';
    width: 28px;
    height: 28px;
    margin: 3px 0 0 3px;
    background: white;
    position: absolute;
    border-radius: 50%;
}

.marker-pin i {
    position: relative;
    z-index: 1;
    color: var(--primary-color);
    transform: rotate(45deg);
    font-size: 16px;
    top: 1px;
    right: 0;
}

/* Hover effect for markers */
.leaflet-marker-icon:hover .marker-pin {
    transform: rotate(-45deg) scale(1.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 0;
    width: 320px !important;
    overflow: hidden;
}

.place-popup-content {
    padding: 0;
}

.popup-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.popup-body {
    padding: 20px;
    background-color: white;
}

.popup-info-item {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
}

.popup-info-item:last-child {
    margin-bottom: 0;
}

.popup-info-icon {
    color: var(--primary-color);
    font-size: 16px;
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.popup-info-text {
    flex: 1;
    color: #4A5568;
    font-size: 14px;
    line-height: 1.5;
}

.popup-info-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.popup-info-text a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.popup-footer {
    padding: 10px 20px;
    background-color: #F7FAFC;
    border-top: 1px solid #EDF2F7;
    font-size: 12px;
    color: #718096;
}

.popup-source {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.source-google {
    background-color: #4285F4;
    color: white;
}

.source-foursquare {
    background-color: #F94877;
    color: white;
}

.source-openstreetmap {
    background-color: #7EBC6F;
    color: white;
}

.leaflet-popup-tip {
    background-color: #F7FAFC;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Cluster styling */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(255, 127, 0, 0.6);
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    margin-left: -20px !important;
    margin-top: -20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: var(--primary-color) !important;
    color: white !important;
    font-weight: bold !important;
    width: 30px !important;
    height: 30px !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
}

.marker-cluster-small:hover,
.marker-cluster-medium:hover,
.marker-cluster-large:hover {
    transform: scale(1.1);
}

/* Attribution styling */
.leaflet-control-attribution {
    font-size: 10px !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    margin-bottom: 10px !important;
    margin-right: 10px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-control-attribution a {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

/* Map loading indication */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 16px;
}

.map-loading .spinner {
    border: 5px solid rgba(255, 127, 0, 0.3);
    border-radius: 50%;
    border-top: 5px solid var(--primary-color);
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

.map-loading-text {
    margin-top: 15px;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 16px;
}

/* Results styling */
.results-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    transition: var(--transition);
}

.results-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: white;
    border-bottom: 1px solid #EDF2F7;
}

.results-count {
    background-color: var(--primary-color);
    color: white;
    border-radius: 30px;
    padding: 5px 15px;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
}

.results-count i {
    margin-right: 5px;
}

.filter-container {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #F7FAFC;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.results-table th {
    background-color: #F7FAFC;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    padding: 15px;
    border-bottom: 2px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table td {
    padding: 15px;
    border-bottom: 1px solid #EDF2F7;
    color: #4A5568;
    transition: var(--transition);
}

.results-table tr:hover td {
    background-color: #F7FAFC;
}

.results-table tr:last-child td {
    border-bottom: none;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 50px 20px;
}

.no-results-icon {
    font-size: 50px;
    color: #CBD5E0;
    margin-bottom: 20px;
}

.no-results-text {
    font-size: 24px;
    color: #4A5568;
    margin-bottom: 10px;
    font-weight: 600;
}

.no-results-hint {
    color: #718096;
    max-width: 400px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    #map-container {
        height: 500px;
    }
}

@media (max-width: 767px) {
    #map-container {
        height: 400px;
    }
    
    .leaflet-popup-content {
        width: 280px !important;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-count {
        margin-top: 10px;
    }
    
    .results-table th, 
    .results-table td {
        padding: 10px;
    }
}

@media (max-width: 575px) {
    #map-container {
        height: 350px;
        border-radius: 12px;
    }
}
