.main-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

#turkiyeHaritasi {
    width: 100%;
    max-width: 1295px; /* Maksimum genişlik */
    height: auto;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Tüm path (il) elementleri için genel stil */
#turkiyeHaritasi path {
    fill: #FFF; /* Varsayılan il rengi */
    stroke: #444444;
    stroke-width: 0.5;
    stroke-miterlimit: 12;
    transition: fill 0.3s ease; /* Renk geçişini yumuşatır */
}

/* Fare ile üzerine gelince */
#turkiyeHaritasi path:hover, #turkiyeHaritasi path.highlight {
    fill: #e0e0e0; /* Rengi hafif gri yapar */
    cursor: pointer;
}

/* JavaScript ile eklenecek olan yeşil renk sınıfı */
/* CSS önceliğini artırmak için seçiciyi daha spesifik hale getiriyoruz */
#turkiyeHaritasi path.yesil {
    fill: #4CAF50; /* Yeşil renk */
}

/* Yeşil olan illerin üzerine gelinceki rengi */
#turkiyeHaritasi path.yesil:hover, #turkiyeHaritasi path.yesil.highlight {
    fill: #388E3C; /* Koyu yeşil hover rengi */
}
text {
    font-family: Arial, sans-serif;
    font-size: 9px;
    fill: #333; /* Metin rengi */
    pointer-events: none;
    transition: font-size 0.2s ease-out, fill 0.2s ease-out;
}

/* İl ismi metnini vurgulama */
text.text-highlight {
    font-size: 11px;
    fill: #000;
    font-weight: bold;
}

/* Tooltip Stilleri */
.map-tooltip {
    position: absolute;
    background-color: rgba(226, 2, 2, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    pointer-events: none; /* Tooltip'in fare olaylarını engellemesini önler */
    white-space: nowrap;
    z-index: 1000;
    transform: translateX(-50%); /* Yatayda ortalamak için */
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease-out, background-color 0.2s ease-out, z-index 0s 0.2s, opacity 0.4s ease-out; /* Opacity transition'ı eklendi */
    max-width: 90px;
    opacity: 0; /* Başlangıçta görünmez */
}

.map-tooltip.visible {
    opacity: 1;
}

/* Tooltip Çentiği */
.map-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: rgba(250, 70, 70, 0.8) transparent transparent transparent;
}

/* @keyframes fadeInUp artık kullanılmıyor, transition ile değiştirildi. */

/* Sürekli göster modunda vurgulama efekti */
.map-tooltip.highlight {
    transform: translate(-50%, -5px) scale(1.1);
    background-color: rgba(255, 50, 50, 0.9);
    z-index: 1001;
    transition: transform 0.2s ease-out, background-color 0.2s ease-out, z-index 0s;
}

/* --- Switch Stilleri --- */
.switch-container {
    margin-top: 1rem;
    text-align: center;
    width: 100%;
    max-width: 1295px;
}

.switch-container hr {
    width: 80%;
    border: none;
    border-top: 1px solid #ccc;
    margin-bottom: 1rem;
}

.switch-wrapper {
    display: flex;
    justify-content: left;
    align-items: center;
    position: absolute;
    bottom: 160px;
    right: 25px;
}

.switch-container .switch-label {
    margin-left: 12px;
    font-family: Arial, sans-serif;
    font-size: 11px;
    color: #333;
}

.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 12px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 1px;
  bottom: 1px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #4CAF50;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(19px);
  -ms-transform: translateX(19px);
  transform: translateX(19px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.map-wrapper {
    position: relative;
}

#afoStats {
    position: absolute;
    bottom: 25px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 10;
}

.stat-box {
    background-color: #fff;
    border: 2px solid #c30000;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-family: 'Altinordu-Bold', sans-serif;
    min-width: 80px;
}

.stat-box-large {
    min-width: 150px;
}

.stat-number {
    color: #004194;
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
}

.stat-label {
    color: #004194;
    font-size: 14px;
    margin-top: 5px;
}

@media (max-width: 768px) {
    #afoStats {
        position: static;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 20px;
        margin-bottom:10px;
    }

    .stat-box {
        min-width: 70px;
        padding: 5px;
    }

    .stat-box-large {
        min-width: 120px;
    }

    .stat-number {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .switch-container {
        display: none;
    }
}

/* Popup Stilleri */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content {
    background-color: #f9f9f9;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px; /* Daha kompakt */
    max-height: 85vh;
    /* overflow: hidden; Dışarıya taşmayı önle - BU SATIR KALDIRILDI */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    border:5px solid #2c7136;
}

.popup-header {
    background-color: #388E3C; /* Yeşil tema */
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* For tooltip positioning */
}

.popup-header h2 {
    margin: 0;
    font-size: 18px; /* Daha kompakt */
}

.popup-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
}
.popup-close-btn:hover {
    opacity: 1;
}

.popup-body {
    padding: 15px;
    overflow-y: auto; /* Sadece body scroll olsun */
}

.popup-school-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.popup-school-list li {
    padding: 8px 5px; /* Daha kompakt */
    border-bottom: 1px solid #e9e9e9;
    font-size: 14px;
}

.popup-school-list li:last-child {
    border-bottom: none;
}

.popup-school-list li strong {
    color: #004194;
}

.popup-school-list li small {
    color: #666;
}

.popup-school-list li a {
    color: #c30000;
    text-decoration: none;
}

.popup-school-list li a:hover {
    text-decoration: underline;
}

.address-toggle-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    margin-top: 5px;
}

.address-toggle-btn:hover {
    background-color: #e9e9e9;
}

.school-address {
    margin-top: 8px;
    font-size: 12px;
    background-color: #fafafa;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #eee;
}

@keyframes wave-animation {
   0% { transform: translateX(-50%) scale(1.2) rotate(-8deg); }
   50% { transform: translateX(-50%) scale(1.2) rotate(8deg); }
   100% { transform: translateX(-50%) scale(1.2) rotate(-8deg); }
}

.popup-tooltip-visual {
    position: absolute;
    left: 50%;
    bottom: 95%; /* Position it slightly overlapping the header */
    transform-origin: bottom center;
    animation: wave-animation 2.5s ease-in-out infinite;
    z-index: 2001; /* Ensure it's above other header content */
}
