/* Map Page Header */
.map-hero {
    position: relative;
    height: 300px;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    display: flex;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.map-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 20px;
}

.map-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.map-hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 25px;
    opacity: 0.9;
}

.map-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
}

/* Main Map Content */
.map-container {
    display: flex;
    min-height: calc(100vh - 200px);
    position: relative;
}

@media (max-width: 768px) {
    .map-container {
        flex-direction: column;
        min-height: calc(100vh - 150px);
    }
}

.map-sidebar {
    width: 350px;
    background-color: var(--light); /* Black background */
    border-right: 1px solid var(--light-gray); /* Dark gray border */
    overflow-y: auto;
    padding: 20px 15px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .map-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--light-gray); /* Dark gray border */
        max-height: 40vh;
    }
}

.map-view {
    flex: 1;
    position: relative;
    min-height: 500px;
}

@media (max-width: 768px) {
    .map-view {
        min-height: 400px;
        height: 60vh;
    }
}

#leafletMap {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    outline: none !important;
    border: none !important;
}

/* Remove pink borders around map tiles */
.leaflet-container {
    background: #f0f0f0 !important;
    outline: none !important;
    border: none !important;
}

.leaflet-tile-container img {
    border: none !important;
    outline: none !important;
}

.leaflet-tile {
    border: none !important;
    outline: none !important;
}

.leaflet-overlay-pane svg {
    border: none !important;
    outline: none !important;
}

.leaflet-overlay-pane svg path {
    border: none !important;
    outline: none !important;
}

/* Additional fix for tile boundaries */
.leaflet-tile-loaded {
    border: none !important;
    outline: none !important;
}

.leaflet-tile-container {
    border: none !important;
    outline: none !important;
}

/* Fix for any pink/grid lines */
img.leaflet-tile {
    border: none !important;
    outline: none !important;
    -webkit-filter: none !important;
    filter: none !important;
}

/* Specific fix for pink coloring */
.leaflet-tile-pane {
    border: none !important;
    outline: none !important;
}

.leaflet-map-pane {
    border: none !important;
    outline: none !important;
}

/* Remove any pink SVG paths */
svg path[stroke*="pink"],
svg path[stroke*="#ff"],
svg path[stroke*="rgb(255"] {
    stroke: none !important;
}

/* Ensure no borders on the container */
.map-container {
    border: none !important;
    outline: none !important;
}

/* Additional fix for tile boundaries */
.leaflet-tile-loaded {
    border: none !important;
    outline: none !important;
}

.leaflet-tile-container {
    border: none !important;
    outline: none !important;
}

/* Fix for any pink/grid lines */
img.leaflet-tile {
    border: none !important;
    outline: none !important;
    -webkit-filter: none !important;
    filter: none !important;
}

/* Specific fix for pink coloring */
.leaflet-tile-pane {
    border: none !important;
    outline: none !important;
}

.leaflet-map-pane {
    border: none !important;
    outline: none !important;
}

/* Remove any pink SVG paths */
svg path[stroke*="pink"],
svg path[stroke*="#ff"],
svg path[stroke*="rgb(255"] {
    stroke: none !important;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h3 {
    color: var(--primary); /* Turquoise accent */
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary);
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.company-filter {
    margin-bottom: 12px;
}

.company-filter label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark); /* White text */
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.company-filter select, .company-filter input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--light-gray); /* Dark gray border */
    border-radius: var(--rounded-sm);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: var(--darker-gray); /* Dark input background */
    color: var(--dark); /* White text */
}

.company-filter select:focus, .company-filter input:focus {
    border-color: var(--primary); /* Turquoise border */
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.company-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar */
.company-list::-webkit-scrollbar {
    width: 6px;
}

.company-list::-webkit-scrollbar-track {
    background: var(--light-gray); /* Dark gray track */
    border-radius: 10px;
}

.company-list::-webkit-scrollbar-thumb {
    background-color: var(--primary); /* Turquoise thumb */
    border-radius: 10px;
}

.company-item {
    padding: 12px;
    margin-bottom: 8px;
    background-color: var(--dark-gray); /* Dark gray background */
    border-radius: var(--rounded-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid var(--primary); /* Turquoise border */
    box-shadow: var(--shadow-sm);
}

.company-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--secondary);
}

.company-item.active {
    background-color: var(--primary); /* Turquoise background */
    color: var(--light); /* Black text for contrast */
    border-left-color: var(--secondary);
}

.company-item h4 {
    margin-bottom: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark); /* White text */
    transition: color 0.3s ease;
}

.company-item.active h4 {
    color: var(--light); /* Black text for contrast */
}

.company-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray); /* Light gray text */
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.company-item.active .company-meta {
    color: rgba(255,255,255,0.8);
}

.company-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.company-category {
    background-color: var(--light-gray); /* Light gray background */
    color: var(--dark); /* White text */
    padding: 3px 8px;
    border-radius: var(--rounded-sm);
    font-size: 0.7rem;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.company-item.active .company-category {
    background-color: rgba(255,255,255,0.2);
    color: var(--light); /* Black text for contrast */
}

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

@media (max-width: 768px) {
    .map-controls {
        top: 10px;
        right: 10px;
    }
}

.control-btn {
    width: 40px;
    height: 40px;
    background-color: var(--dark-gray); /* Dark gray background */
    border: 1px solid var(--light-gray); /* Dark gray border */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    color: var(--dark); /* White text */
    z-index: 100;
}

.control-btn:hover {
    background-color: var(--light-gray); /* Light gray background */
    transform: scale(1.1);
}

/* Info Window Styles */
.info-window {
    min-width: 250px;
    max-width: 300px;
    font-family: 'Inter', sans-serif;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.info-window-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    margin: 0;
}

.info-window-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-window-content {
    padding: 15px;
    background: white;
}

.info-window-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #333;
}

.info-window-item:last-child {
    margin-bottom: 0;
}

.info-window-item i {
    color: var(--primary);
    margin-right: 10px;
    min-width: 16px;
    font-size: 14px;
}

.info-window-actions {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

.info-window-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-window-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.info-window-btn i {
    font-size: 12px;
}

/* Custom Popup Styles */
.custom-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    border: none;
}

.custom-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    width: auto !important;
}

.custom-popup .leaflet-popup-tip {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: var(--light); /* Black background */
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray); /* Light gray border */
    border-top: 4px solid var(--primary); /* Turquoise top border */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Custom Marker Styles */
.custom-marker {
    width: 20px;
    height: 20px;
    background-color: #06b6d4; /* Turquoise color */
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;
    position: relative;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.custom-marker::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Leaflet Attribution Control Styling */
.leaflet-control-attribution {
    position: absolute;
    bottom: 0;
    right: 0;
    background: transparent !important;
    padding: 2px 5px !important;
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 200px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}

.leaflet-control-attribution a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none !important;
}

.leaflet-control-attribution a:hover {
    color: rgba(255, 255, 255, 1) !important;
    text-decoration: underline !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .map-hero {
        height: 250px;
    }
    
    .map-hero h1 {
        font-size: 2rem;
    }
    
    .company-list {
        max-height: 150px;
    }
    
    .leaflet-control-attribution {
        font-size: 8px !important;
        max-width: 150px;
    }
}