/* ==========================================================================
   alsatbu.com - 3D Güneş & Gölge Simülasyonu ve Solar Analiz Modülü CSS
   Mimari kalitede, MapLibre GL 3D ve SunCalc destekli çevre simülasyonu
   ========================================================================== */

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

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

/* Üst Kontrol & Simülasyon Paneli */
.gunes-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);
}

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

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

.gunes-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;
}

/* Önayar Düğmeleri (Sabah, Öğle, İkindi vb.) */
.gunes-preset-btn,
.gunes-season-btn {
    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;
}

.gunes-preset-btn:hover,
.gunes-season-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.gunes-preset-btn.active,
.gunes-season-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #d97706;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.gunes-season-btn.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Canlı Zaman Kaydırıcı (Timeline Slider) */
.gunes-timeline-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.gunes-play-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f59e0b, #ea580c);
    border: none;
    color: #ffffff;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.3);
    transition: transform 0.15s ease, background 0.15s ease;
}

.gunes-play-btn:hover {
    transform: scale(1.05);
}

.gunes-play-btn:active {
    transform: scale(0.95);
}

.gunes-slider-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gunes-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #475569;
}

.gunes-time-display {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    font-feature-settings: "tnum";
    letter-spacing: -0.02em;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 2px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gunes-time-display i {
    color: #f59e0b;
}

/* Range Input Stil */
.gunes-range-input {
    width: 100%;
    height: 7px;
    appearance: none;
    background: linear-gradient(to right, #64748b 0%, #f59e0b 25%, #fbbf24 50%, #f59e0b 75%, #334155 100%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.gunes-range-input::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #d97706;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: grab;
    transition: transform 0.1s ease;
}

.gunes-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.gunes-range-input::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.25);
}

.gunes-range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #d97706;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: grab;
}

/* 3D Harita Tuvali ve Görsel Alan */
.gunes-map-viewport {
    position: relative;
    width: 100%;
    height: 520px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    background: #0f172a;
}

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

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

.gunes-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;
}

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

.gunes-floating-btn.active {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

/* Canlı Güneş Pusula Rozeti (Harita Sol Üst) */
.gunes-compass-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    font-size: 12px;
}

.gunes-compass-disc {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
}

.gunes-compass-needle {
    position: absolute;
    width: 3px;
    height: 14px;
    background: #ef4444;
    border-radius: 2px;
    top: 3px;
    left: 14px;
    transform-origin: 50% 14px;
    transition: transform 0.2s ease-out;
}

.gunes-compass-sun-indicator {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    box-shadow: 0 0 8px #f59e0b;
    transition: all 0.2s ease-out;
}

.gunes-compass-text {
    display: flex;
    flex-direction: column;
}

.gunes-compass-text strong {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
}

.gunes-compass-text span {
    font-size: 10.5px;
    color: #cbd5e1;
}

/* Harita Altı Lejant / Renk Bilgisi */
.gunes-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;
}

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

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

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

.gunes-legend-color.target {
    background: #f59e0b;
    border: 1px solid #d97706;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.gunes-legend-color.surrounding {
    background: #cbd5e1;
    border: 1px solid #94a3b8;
}

.gunes-legend-color.shadow {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(15, 23, 42, 0.7);
}

/* Yükleniyor Göstergesi */
.gunes-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;
}

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

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

/* Alt Analitik İstatistik Kartları */
.gunes-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gunes-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;
}

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

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

.gunes-metric-icon.altitude {
    background: #fef3c7;
    color: #d97706;
}

.gunes-metric-icon.azimuth {
    background: #e0e7ff;
    color: #4338ca;
}

.gunes-metric-icon.daylight {
    background: #ecfdf5;
    color: #059669;
}

.gunes-metric-icon.score {
    background: #fdf2f8;
    color: #db2777;
}

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

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

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

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

/* Cephe Güneşlenme Karnesi (Facade Grid) */
.gunes-facades-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.gunes-facades-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

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

.gunes-facades-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gunes-facade-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gunes-facade-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #cbd5e1;
}

.gunes-facade-item.active-sun::before {
    background: #f59e0b;
}

.gunes-facade-dir {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.gunes-facade-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 6px;
}

.gunes-facade-status.active {
    background: #fef3c7;
    color: #b45309;
}

.gunes-facade-status.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.gunes-facade-desc {
    font-size: 10.5px;
    color: #64748b;
    line-height: 1.4;
}

/* Bilgilendirme ve Uyarı Kutusu */
.gunes-notice-box {
    margin-top: 14px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

.gunes-notice-box i {
    font-size: 16px;
    color: #d97706;
    margin-top: 1px;
}

/* Tam Ekran Durumu */
.gunes-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) {
    .gunes-map-viewport {
        height: 380px;
    }
    .gunes-ctrl-row {
        flex-direction: column;
        align-items: stretch;
    }
    .gunes-timeline-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .gunes-play-btn {
        align-self: center;
    }
    .gunes-facades-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gunes-dashboard-grid {
        grid-template-columns: 1fr;
    }
    .gunes-legend-strip {
        font-size: 11px;
        padding: 6px 10px;
    }
}
