/* ==========================================================================
   alsatbu.com - 3D Topoğrafya, Eğim ve Kot Farkı Analiz Modülü CSS
   ArchiMap mimarisinde 3D Terrain, Eşyükselti Eğrileri ve Arazi Kesiti
   ========================================================================== */

.alsatbu-topo-container {
    position: relative;
    width: 100%;
    margin-bottom: 25px;
    font-family: inherit;
    color: #1e293b;
    box-sizing: border-box;
}

.alsatbu-topo-container * {
    box-sizing: border-box;
}

/* Üst Kontrol & Filtre Kartı */
.topo-controls-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.topo-ctrl-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.topo-ctrl-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.topo-ctrl-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.topo-btn-option {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    padding: 6px 13px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topo-btn-option:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.topo-btn-option.active {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #047857;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

/* 3D Topoğrafya Harita Tuvali */
.topo-map-viewport {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    background: #0f172a;
}

.topo-map-canvas {
    width: 100%;
    height: 100%;
}

/* Harita İçi Kayan Kontroller (Overlay Controls) */
.topo-floating-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.topo-floating-btn {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
}

.topo-floating-btn:hover {
    background: #ffffff;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.topo-floating-btn.active {
    background: #059669;
    border-color: #047857;
    color: #ffffff;
}

/* Harita Sol Üst Rakım ve Eğim Rozeti */
.topo-badge-overlay {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.topo-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #10b981;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex: 0 0 36px;
}

.topo-badge-info strong {
    font-size: 15px;
    font-weight: 800;
    display: block;
    letter-spacing: -0.01em;
}

.topo-badge-info span {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
}

/* Harita Altı Lejant / Renk Bilgisi */
.topo-legend-strip {
    position: absolute;
    bottom: 12px;
    left: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 10;
    backdrop-filter: blur(4px);
    font-size: 12px;
    color: #334155;
}

.topo-legend-items {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topo-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.topo-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.topo-legend-color.pin {
    background: #10b981;
    border: 1px solid #059669;
}

.topo-legend-color.contour {
    background: #94a3b8;
    border: 1px dashed #475569;
}

.topo-legend-color.radius {
    background: rgba(16, 185, 129, 0.15);
    border: 1px dashed #10b981;
}

/* Yükleniyor Göstergesi */
.topo-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.topo-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: topoSpin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes topoSpin {
    to { transform: rotate(360deg); }
}

/* Gösterge Kartları Grid (Elevation & Slope Metrics) */
.topo-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.topo-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topo-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.topo-metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: 0 0 40px;
}

.topo-metric-icon.altitude {
    background: #ecfdf5;
    color: #059669;
}

.topo-metric-icon.slope {
    background: #eff6ff;
    color: #2563eb;
}

.topo-metric-icon.diff {
    background: #fef3c7;
    color: #d97706;
}

.topo-metric-icon.suitability {
    background: #fdf2f8;
    color: #db2777;
}

.topo-metric-data {
    display: flex;
    flex-direction: column;
}

.topo-metric-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.topo-metric-value {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    font-feature-settings: "tnum";
}

.topo-metric-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* İnteraktif Arazi Kesiti (Elevation Profile Card) */
.topo-profile-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.topo-profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.topo-profile-head h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topo-profile-directions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.topo-profile-btn {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.topo-profile-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.topo-profile-btn.active {
    background: #059669;
    border-color: #047857;
    color: #ffffff;
}

/* SVG Kesit Çizim Alanı */
.topo-profile-chart-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.topo-profile-svg {
    width: 100%;
    height: 100%;
}

.topo-profile-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
    display: none;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -120%);
}

.topo-profile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 11.5px;
    color: #64748b;
    font-feature-settings: "tnum";
}

/* İmar ve İnşaat Uygunluk Rehberi */
.topo-guide-box {
    margin-top: 16px;
    padding: 14px 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 12px;
    color: #166534;
    line-height: 1.5;
}

.topo-guide-box i {
    font-size: 17px;
    color: #16a34a;
    margin-top: 2px;
}

/* Tam Ekran Durumu */
.topo-map-viewport.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    border: none !important;
}

/* Mobil Uyumluluk */
@media (max-width: 768px) {
    .topo-map-viewport {
        height: 380px;
    }
    .topo-ctrl-row {
        flex-direction: column;
        align-items: stretch;
    }
    .topo-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .topo-profile-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .topo-legend-strip {
        font-size: 11px;
        padding: 6px 10px;
    }
}
