/* static/css/base_style.css */
*,
*::before,
*::after {
    box-sizing: border-box;
}
:root {
    --main-orange: rgb(244, 147, 38);
    --theme-bg: rgb(17, 22, 23);
    --theme-header-bg: rgba(17, 22, 23, 0.85);
    --theme-header-border: rgba(221, 153, 51, 0.2);
    --theme-text-light: #f0f0f0;
    --theme-text-dark: #e2e2e2;
    --theme-text-muted: #a0a0a0;
    --theme-card-bg: #090909;
    --header-logo-image: url('../images/Avenco Logo Yazili.png');
    --icon-filter: invert(1);
}

html[data-theme="light"] {
    --theme-bg: #f0f2f5;
    --theme-header-bg: rgba(255, 255, 255, 0.85);
    --theme-header-border: rgba(0, 0, 0, 0.1);
    --theme-text-light: #000;
    --theme-text-dark: #000;
    --theme-text-muted: #4d4d4d;
    --theme-card-bg: #ffffff;
    --header-logo-image: url('../images/Avenco Logo Siyah.png');
    --icon-filter: invert(0);
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    background-color: var(--theme-bg);
    color: var(--theme-text-dark);
    transition: background-color 0.4s ease, color 0.4s ease;
    margin: 0;
}
h1, h2, h3, h4, h5, h6, .card-title, .modal-header h3 {
    font-weight: 600;
}
.btn, strong, b {
    font-weight: 400;
}
.header {
    background-color: var(--theme-header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--theme-header-border);
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.logo-link {
    display: block;
    width: 150px;
    height: 35px;
    background-image: var(--header-logo-image);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center left;
    transition: background-image 0.4s ease;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-button {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 50%;
    padding: 0;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    text-decoration: none;
}
.header-button:hover {
    box-shadow: 0 0 10px -2px var(--main-orange);
    background-color: rgba(244, 147, 38, 0.1);
}
.theme-toggle {
    position: relative;
}
.theme-toggle img {
    position: absolute;
    width: 22px;
    height: 22px;
}
.sun-icon { display: block; }
.moon-icon { display: none; }
html[data-theme="light"] .sun-icon { display: none; }
html[data-theme="light"] .moon-icon { display: block; }
.themed-icon {
    filter: var(--icon-filter);
    transition: filter 0.4s ease;
}

.glass-effect {
    /* "Buzlu Cam" Görüntüsü */
    background: rgba(255, 255, 255, 0.1); /* Karanlık tema için yarı şeffaf */
    backdrop-filter: blur(10px);
    
    /* Kenarlık ve Gölge */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    
    /* İçerik için dolgu ve renk */
    padding: 2rem;
    color: white;
}

/* Işıklı tema için alternatif görünüm */
html[data-theme="light"] .glass-effect {
    background: rgba(255, 255, 255, 0.7); /* Daha az şeffaf */
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}



/* static/css/base_style.css dosyasının sonuna ekleyin */

/* --- ÇİFT KÖŞEGEN GLOW EFEKTİ --- */

/* Bu div, iki glow'u da barındıran ana katmandır */
#background-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;   /* Tüm içeriğin arkasında kalmasını sağlar */
    pointer-events: none; /* Tıklanamaz yapar */
    overflow: hidden;
}

/* Birinci Glow (Sol Üst -> Sağ Alt) */
#background-glow-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    
    /* Glow'un özellikleri */
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--main-orange), transparent 60%);
    opacity: 0.3;
    filter: blur(100px);

    /* Animasyon tanımı */
    animation-name: glow-move-top-left;
    animation-duration: 25s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

/* İkinci Glow (Sağ Üst -> Sol Alt) */
#background-glow-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0; /* Başlangıç pozisyonunu sağ üst köşe yapar */
    
    /* Glow'un özellikleri (farklı bir renk de kullanabilirsiniz) */
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #3498db, transparent 60%); /* Örnek olarak mavi bir renk */
    opacity: 0.25;
    filter: blur(120px);

    /* Animasyon tanımı */
    animation-name: glow-move-top-right;
    animation-duration: 22s; /* Farklı süreler daha doğal bir görünüm sağlar */
    animation-delay: -10s;  /* Animasyonların aynı anda başlamaması için */
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}


/* --- ANİMASYONLAR --- */

/* Sol üstten sağ alta hareket */
@keyframes glow-move-top-left {
    from { transform: translate(-25%, -25%); }
    to { transform: translate(calc(100vw - 200px), calc(100vh - 200px)); }
}

/* Sağ üstten sol alta hareket */
@keyframes glow-move-top-right {
    from { transform: translate(25%, -25%); }
    to { transform: translate(calc(-100vw + 200px), calc(100vh - 200px)); }
}


/* body etiketine 'scrolled' sınıfı eklendiğinde bu stil aktif olur */
body.scrolled #world-map-container {
    filter: grayscale(100%) brightness(1) blur(0px); /* Net ve daha parlak */
    opacity: 0.6; /* Daha görünür */
}

/* Leaflet haritasının boyutunu ve arka planını ayarlar */


/* Leaflet'ın varsayılan kontrol elemanlarını (logo, zoom) gizle */
.leaflet-control-container {
    display: none !important;
}
.leaflet-pane {
    background: none;
}
.leaflet-container {
    background: transparent !important;
}


/* =================================== */
/* ===         PİNG EFEKTİ         === */
/* =================================== */

.ping-marker {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ping'in merkezindeki turuncu nokta */
.ping-dot {
    width: 12px;
    height: 12px;
    background-color: #ff8c00; /* Koyu turuncu */
    border-radius: 50%;
    box-shadow: 0 0 8px #ff8c00, 0 0 12px #ff8c00;
}

/* Ping'in dışa doğru yayılan dalgası */
.ping-wave {
    width: 12px;
    height: 12px;
    background-color: transparent;
    border: 2px solid #ff8c00;
    border-radius: 50%;
    position: absolute;
    animation: ping-animation 1.5s ease-out infinite;
}

@keyframes ping-animation {
    /* Animasyonu 3 parçaya ayırıyoruz:
       %0 - %70: Büyüme ve kaybolma efekti
       %70.1 - %100: Gecikme (bekleme) süresi. Bu sürede dalga görünmez ve hareketsiz kalır.
    */
    0% {
        transform: scale(0.1);
        opacity: 0.8;
    }
    30% {
        /* --wave-scale değişkeni JS tarafından dinamik olarak ayarlanır */
        transform: scale(var(--wave-scale, 5)); 
        opacity: 0;
    }
    30.1% {
        /* Bekleme periyodunun başında ölçeği sıfırla */
        transform: scale(0.1);
        opacity: 0;
    }
    100% {
        /* Bekleme periyodunun sonuna kadar görünmez kal */
        transform: scale(0.1);
        opacity: 0;
    }
}

/* --- TEMA DEĞİŞTİRİCİ İKON GÖRÜNÜRLÜĞÜ --- */

/* Varsayılan olarak (karanlık tema) güneşi gizle, ayı göster */
html[data-theme="dark"] #sun-icon {
    display: none;
}
html[data-theme="dark"] #moon-icon {
    display: block;
}

/* Aydınlık temada ayı gizle, güneşi göster */
html[data-theme="light"] #sun-icon {
    display: block;
}
html[data-theme="light"] #moon-icon {
    display: none;
}



/* Genel Dropdown Stilleri (Tema Duyarlı) */
select {
    background-color: var(--input-background-color); /* Tema renginden gelen input arkaplanı */
    color: var(--input-text-color); /* Tema renginden gelen input metin rengi */
    border: 1px solid var(--border-color); /* Tema rengine duyarlı kenarlık */
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    -webkit-appearance: none; /* Varsayılan tarayıcı stilini kaldır */
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%236c757d' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); /* Özel ok ikonu */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    transition: all 0.2s ease-in-out;
    
}

select:focus {
    border-color: var(--primary-color); /* Odaklandığında ana renk */
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
    outline: none;
}

/* Dropdown içindeki seçenekler (option) için */
select option {
    background-color: var(--input-background-color); /* Arkaplan */
    color: var(--input-text-color); /* Metin rengi */
}

/* Dark mode için özel ayarlamalar (tema_switcher.js'deki dark-mode class'ına göre) */
.dark-mode select {
    background-color: var(--dark-input-background-color, #333); /* Karanlık tema için varsayılan */
    color: var(--dark-input-text-color, #f8f9fa);
    border-color: var(--dark-border-color, #555);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ccc' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); /* Karanlıkta daha açık ok */
}

.dark-mode select option {
    background-color: var(--dark-input-background-color, #333);
    color: var(--dark-input-text-color, #f8f9fa);
}

/* =================================================== */
/* ===      FİNAL HARİTA YERLEŞİM KURALLARI        === */
/* =================================================== */


/* Ping stilleriniz de bu dosyada olmalı */
.ping-marker {
    width: 60px;
    height: 60px;
    position: relative;
}

.ping-dot, .ping-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.ping-dot {
    width: 10px;
    height: 10px;
    background-color: var(--main-orange);
    box-shadow: 0 0 5px rgba(244, 147, 38, 0.7);
    z-index: 1;
}

.ping-wave {
    width: 25px;
    height: 25px;
    border: 2px solid var(--main-orange);
    animation: wave-animation 1.5s infinite;
}

@keyframes wave-animation {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* =================================================== */
/* ===         ÖZEL OLAY PING'İ STİLLERİ           === */
/* =================================================== */

.ping-marker--event .ping-dot {
    width: 15px;
    height: 15px;
    animation-name: fade-to-orange;
    animation-duration: 6s; /* Solma süresi */
    animation-fill-mode: forwards; /* Bittiğinde turuncu kalır (JS sınıfı kaldırana kadar) */
}

.ping-marker--event .ping-wave {
    animation-name: wave-animation, fade-to-orange;
    animation-duration: inherit, 6s;
    animation-iteration-count: infinite, 1; /* Dalga sonsuz, renk solması 1 kez */
    animation-fill-mode: none, forwards;
}

/* =================================================== */
/* ===         RENK SOLMA ANİMASYONU               === */
/* =================================================== */

@keyframes fade-to-orange {
  from {
    background-color: #ffc107;
    border-color: #ffc107;
    box-shadow: 0 0 10px #ffc107, 0 0 20px #ffc107;
  }
  to {
    background-color: var(--main-orange);
    border-color: var(--main-orange);
    box-shadow: 0 0 5px rgba(244, 147, 38, 0.7);
  }
}


/* =================================================== */
/* ===         SERVİS RAPORU ÇİZGİ ANİMASYONU      === */
/* =================================================== */

.animated-service-line {
    stroke-dasharray: 1000; /* Çizginin toplam uzunluğu (büyük bir sayı) */
    stroke-dashoffset: 1000; /* Başlangıçta çizgi görünmez */
    /* Animasyon: adı, süresi, dolgu modu */
    animation: draw-line 6s forwards; 
}

@keyframes draw-line {
    /* Başlangıçta sarı ve görünür */
    0% {
        stroke: #ffc107; /* Olay pingi sarısı */
        opacity: 0.8;
        stroke-dashoffset: 1000; /* Çizgi çizilmemiş */
    }
    /* Ortasında turuncuya döner */
    50% {
        stroke: var(--main-orange);
    }
    /* Sonunda hem çizim tamamlanır hem de kaybolur */
    100% {
        stroke: var(--main-orange);
        opacity: 0;
        stroke-dashoffset: 0; /* Çizgi tamamen çizilmiş */
    }
}


/* static/css/base_style.css -> En sona eklenecek */

/* Tam ekran butonu varsayılan olarak header-button stilini alır, bu yüzden görünürdür */
#fullscreen-btn {
    /* İkon renginin tema ile uyumlu olması için ekledik */
    filter: var(--theme-icon-filter); 
}

/* =================================================== */
/* GLOBAL ARKA PLAN HARİTASI (STABİL SÜRÜM)             */
/* =================================================== */

#world-map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;

    /* Animasyon için gerekli kodlar */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0s; 
}

#world-map-container #map-id {
    height: 100%;
    width: 100%;
}

.leaflet-control-container {
    display: none !important;
}


#map-id {
    width: 100%;
    height: 100%;
    /* Çalışan sayfadaki gibi, haritayı biraz daha büyük göstererek
       kenarlarda boşluk kalmamasını sağlıyoruz. Ping kayması sorununu
       JavaScript'teki invalidateSize() komutu çözdüğü için bu artık güvenli. */
    transform: scale(1.3);
}

.leaflet-control-container {
    display: none !important;
}

/* SADECE EKRAN 768px'DEN DAR İSE BU KURAL ÇALIŞACAK */
@media (max-width: 768px) {
    #world-map-container {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.4s ease, visibility 0s 0.4s; 
    }
}