/* OpenStreetMap 3D Map Styles with MapLibre GL JS */
#map {
    width: 100%;
    height: 100vh;
    min-height: 600px;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Harita loading efekti */
#map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: opacity 1s ease;
}

#map.loaded::before {
    opacity: 0;
    pointer-events: none;
}

/* MapLibre GL kontrolleri */
.maplibregl-ctrl-group {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.maplibregl-ctrl-group:not(:empty) {
    margin: 10px !important;
}

.maplibregl-ctrl-group > button {
    background: transparent !important;
    border: none !important;
    transition: all 0.3s ease !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
}

.maplibregl-ctrl-group > button:hover {
    background: rgba(102, 126, 234, 0.15) !important;
    transform: scale(1.05);
}

/* Navigasyon kontrolleri */
.maplibregl-ctrl-compass {
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
}

.maplibregl-ctrl-compass.maplibregl-ctrl-compass-rotated {
    background: rgba(102, 126, 234, 0.2) !important;
}

.maplibregl-ctrl-zoom-in,
.maplibregl-ctrl-zoom-out {
    font-size: 18px !important;
    color: #333 !important;
    font-weight: bold !important;
}

/* Fullscreen button */
.maplibregl-ctrl-fullscreen {
    background-image: none !important;
}

.maplibregl-ctrl-fullscreen::before {
    content: '⛶';
    font-size: 18px;
    color: #333;
}

/* Popup stilleri */
.maplibregl-popup {
    max-width: 380px !important;
    z-index: 1000 !important;
}

.maplibregl-popup-content {
    background: rgba(255, 255, 255, 0.98) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.osm-3d-popup .maplibregl-popup-content {
    min-width: 320px;
}

.maplibregl-popup-close-button {
    font-size: 22px !important;
    padding: 10px 14px !important;
    color: #888 !important;
    transition: all 0.3s ease !important;
    border-radius: 8px;
}

.maplibregl-popup-close-button:hover {
    color: #FF6B6B !important;
    background: rgba(255, 107, 107, 0.1) !important;
}

.maplibregl-popup-tip {
    border-top-color: rgba(255, 255, 255, 0.98) !important;
    filter: drop-shadow(0 -4px 8px rgba(0, 0, 0, 0.1));
}

/* Custom marker stilleri */
.osm-3d-marker {
    position: relative;
    animation: markerFloat 3s ease-in-out infinite;
}

@keyframes markerFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.osm-3d-marker::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #667eea;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.osm-3d-marker::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) scale(3);
        opacity: 0;
    }
}

/* Attribution */
.maplibregl-ctrl-attrib {
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 11px !important;
    backdrop-filter: blur(10px);
}

.maplibregl-ctrl-attrib a {
    color: #667eea !important;
    font-weight: 600;
}

.maplibregl-ctrl-attrib a:hover {
    color: #764ba2 !important;
}

/* Scale control */
.maplibregl-ctrl-scale {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #ddd !important;
    border-top: none !important;
    border-radius: 0 0 8px 8px !important;
    padding: 4px 12px !important;
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 12px !important;
}

/* Rotate control */
.maplibre-rotate-3d {
    background: white !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 16px !important;
}

.maplibre-rotate-3d:hover {
    background: #f0f0f0 !important;
}

.maplibre-rotate-3d:active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
}

/* 3D Toggle butonu */
.map-3d-toggle {
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border: 2px solid #667eea;
    color: #667eea;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    font-family: inherit;
}

.map-3d-toggle:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.map-3d-toggle.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Loading state */
.maplibregl-map {
    position: relative;
}

/* Pitch/Bearing göstergesi */
.maplibregl-ctrl-pitchtoggle-3d {
    background: rgba(102, 126, 234, 0.1) !important;
}

/* Compass active state */
.maplibregl-ctrl-compass.maplibregl-ctrl-compass-rotated {
    background: rgba(102, 126, 234, 0.15) !important;
}

/* 3D binalar için özel renkler */
.maplibregl-style-dark .fill-extrusion-layer {
    fill-extrusion-opacity: 0.8;
}

/* Harita container */
.osm-3d-map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Bilgi popup içeriği */
.osm-3d-popup .property-info {
    padding: 16px;
}

.osm-3d-popup .property-image {
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.osm-3d-popup .property-title {
    font-weight: 600;
    font-size: 16px;
    margin: 12px 0 8px;
    color: #333;
}

/* Dark mode için */
.dark .maplibregl-popup-content {
    background: rgba(30, 30, 30, 0.98) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .maplibregl-popup-tip {
    border-top-color: rgba(30, 30, 30, 0.98) !important;
}

.dark .maplibregl-ctrl-group {
    background: rgba(40, 40, 40, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark .maplibregl-ctrl-zoom-in,
.dark .maplibregl-ctrl-zoom-out,
.dark .maplibregl-ctrl-fullscreen::before,
.dark .maplibregl-ctrl-compass {
    color: white !important;
}

.dark .map-3d-toggle {
    background: rgba(40, 40, 40, 0.95);
    color: #667eea;
    border-color: #667eea;
}

.dark .map-3d-toggle:hover,
.dark .map-3d-toggle.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.dark .osm-3d-popup .property-title {
    color: white;
}

/* Responsive tasarım */
@media (max-width: 768px) {
    #map {
        height: 60vh;
        min-height: 400px;
    }
    
    .maplibregl-popup-content {
        max-width: 280px !important;
    }
    
    .osm-3d-popup .maplibregl-popup-content {
        min-width: 260px;
    }
    
    .map-3d-toggle {
        bottom: 20px;
        right: 10px;
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .osm-3d-marker {
        width: 60px !important;
        height: 30px !important;
        font-size: 11px !important;
    }
    
    .maplibregl-ctrl-group {
        margin: 5px !important;
    }
}

/* Attribution özelleştirmesi */
.maplibregl-ctrl-bottom-right {
    right: 10px !important;
    bottom: 10px !important;
}

.maplibregl-ctrl-bottom-left {
    left: 10px !important;
    bottom: 10px !important;
}

/* Canvas container */
.maplibregl-canvas-container {
    cursor: grab;
}

.maplibregl-canvas-container:active {
    cursor: grabbing;
}

/* Feature highlight efekti */
.mapboxgl-feature-highlight {
    stroke: #667eea;
    stroke-width: 2px;
}

/* Extra stiller */
.osm-3d-marker {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Theme toggle button */
.maplibre-theme-toggle {
    background: white !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 16px !important;
}

.maplibre-theme-toggle:hover {
    background: #f0f0f0 !important;
}

/* Fly-in animasyonu */
@keyframes flyIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.maplibregl-popup {
    animation: flyIn 0.3s ease-out;
}

/* Building hover efekti */
.maplibregl-buildings-hover {
    fill-extrusion-color: #ff6b6b !important;
    fill-extrusion-opacity: 1 !important;
}

/* Extra buton stilleri */
.maplibregl-ctrl-group > button:focus {
    outline: none !important;
}

/* Water layer */
.maplibregl-water-layer {
    fill-color: #a4dbf8;
    fill-opacity: 0.7;
}

/* Park ve yeşil alanlar */
.maplibregl-park-layer {
    fill-color: #c8e6c9;
    fill-opacity: 0.8;
}

/* Road layer */
.maplibregl-road-layer {
    line-color: #ffffff;
    line-width: 2;
    line-opacity: 0.9;
}
