/**
 * Loading Animation - Spinning Globe
 */

.globe-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.globe {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    box-shadow: 
        0 0 20px rgba(59, 130, 246, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
    animation: rotate-globe 3s linear infinite;
    overflow: hidden;
}

.globe-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 8px,
            rgba(255, 255, 255, 0.1) 8px,
            rgba(255, 255, 255, 0.1) 10px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 8px,
            rgba(255, 255, 255, 0.1) 8px,
            rgba(255, 255, 255, 0.1) 10px
        );
    animation: rotate-grid 6s linear infinite reverse;
}

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

@keyframes rotate-grid {
    0% {
        transform: rotate(0deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1.1);
    }
}

/* Pulse effect for globe */
.globe::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.3);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }
    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/**
 * Colorful Map Markers
 */

.colorful-marker-container {
    background: transparent;
    border: none;
}

.colorful-marker {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 
        0 3px 10px rgba(0, 0, 0, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.colorful-marker:hover {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}

.colorful-marker .marker-number {
    transform: rotate(45deg);
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.colorful-marker .marker-pin {
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 12px solid;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

/* Marker bounce animation on add */
.colorful-marker-container {
    animation: marker-bounce 0.6s ease-out;
}

@keyframes marker-bounce {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    60% {
        transform: translateY(10px);
        opacity: 1;
    }
    80% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/**
 * Highlight Pulse Effect
 */

.highlight-pulse {
    animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3), 0 10px 25px -5px rgba(59, 130, 246, 0.2);
        transform: scale(1.02);
    }
}

/**
 * Collapsible Chevron Rotation
 */

.rotate-180 {
    transform: rotate(180deg);
}

/**
 * Custom Map Layer Control Buttons
 */

.map-layer-controls {
    position: absolute;
    bottom: 0px;
    right: 10px;
    z-index: 1000;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 400px;
}

.layer-btn {
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

.layer-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.layer-btn.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Different colors for each layer */
.layer-btn[data-layer="street"] {
    border-color: #3B82F6;
    color: #3B82F6;
}

.layer-btn[data-layer="street"].active {
    background: #3B82F6;
    color: white;
}

.layer-btn[data-layer="satellite"] {
    border-color: #10B981;
    color: #10B981;
}

.layer-btn[data-layer="satellite"].active {
    background: #10B981;
    color: white;
}

.layer-btn[data-layer="terrain"] {
    border-color: #F59E0B;
    color: #F59E0B;
}

.layer-btn[data-layer="terrain"].active {
    background: #F59E0B;
    color: white;
}

.layer-btn[data-layer="dark"] {
    border-color: #6B7280;
    color: #6B7280;
}

.layer-btn[data-layer="dark"].active {
    background: #6B7280;
    color: white;
}

/* Hide default Leaflet layer control */
.leaflet-control-layers {
    display: none !important;
}

/**
 * Loading State Improvements
 */

#loading-state {
    background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
    border-radius: 12px;
    padding: 40px 20px;
}

/**
 * Compact List Styles
 */

/* Compact Quick Find Items */
.quick-find-item {
    padding: 10px 12px !important;
    cursor: pointer;
}

.quick-find-item:hover {
    background-color: #374151 !important;
    transform: translateX(-2px);
}

.quick-find-item .w-6 {
    width: 20px !important;
    height: 20px !important;
    font-size: 11px !important;
}

.quick-find-item .font-semibold {
    font-size: 13px !important;
}

.quick-find-item .text-xs {
    font-size: 11px !important;
}

/* Clickable location name styling */
.location-name {
    position: relative;
    display: inline-block;
}

.location-name::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #60A5FA;
    transition: width 0.3s ease;
}

.location-name:hover::after {
    width: 100%;
}

.location-name:hover {
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

/* Compact Location Detail Cards */
#location-details-container .card {
    padding: 16px !important;
    margin-bottom: 16px !important;
}

#location-details-container h3 {
    font-size: 18px !important;
}

/* Detail card location name styling */
.detail-location-name {
    position: relative;
    display: inline-block;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: all 0.3s ease;
}

.detail-location-name:hover {
    text-decoration-color: #2563EB;
}

#location-details-container .w-10 {
    width: 32px !important;
    height: 32px !important;
    font-size: 16px !important;
}

#location-details-container .text-sm {
    font-size: 12px !important;
}

#location-details-container .text-xs {
    font-size: 11px !important;
}

#location-details-container .text-2xl {
    font-size: 20px !important;
}

/* Compact Buttons */
#location-details-container .btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
}

#location-details-container .btn i {
    font-size: 12px !important;
}

/* Compact Collapsible Headers */
.collapsible-header {
    padding: 10px 12px !important;
    font-size: 13px !important;
}

.collapsible-header h4 {
    font-size: 13px !important;
}

.collapsible-header i {
    font-size: 12px !important;
}

/* Compact Collapsible Content */
.collapsible-content {
    padding: 12px !important;
    font-size: 12px !important;
}

.collapsible-content .text-sm {
    font-size: 11px !important;
}

.collapsible-content .px-2 {
    padding-left: 6px !important;
    padding-right: 6px !important;
    font-size: 10px !important;
}

/**
 * Responsive Adjustments
 */

@media (max-width: 768px) {
    .globe-spinner {
        width: 80px;
        height: 80px;
    }
    
    .colorful-marker {
        width: 28px;
        height: 28px;
    }
    
    .colorful-marker .marker-number {
        font-size: 14px;
    }
    
    #map {
        height: 400px !important;
    }
}
