/* ==================================== */
/* 1. Kapsayıcı ve Genel Stil Düzenlemeleri (Masaüstü/Mobil Uyumlu) */
/* ==================================== */

#afad-app {
    /* AMP benzeri sade fontlar ve genel responsive ayarlar */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    max-width: 1200px;
    margin: 20px auto;
    padding: 10px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.afad-title {
    background: #c0392b; /* AFAD kırmızısı */
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 20px;
}

#afad-info, #afad-error {
    text-align: center;
    padding: 10px 0;
}

#afad-error {
    color: #e74c3c;
    font-weight: 700;
}

/* ==================================== */
/* 2. Filtre ve Kontroller (Flexbox ile Esneklik) */
/* ==================================== */

#afad-controls {
    display: flex;
    flex-wrap: wrap; 
    gap: 15px;
    align-items: center;
    justify-content: center;
    padding: 15px;
    margin-bottom: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #eee;
}

#afad-controls label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

#afad-controls select,
#afad-controls input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    flex-grow: 1; /* Kontrol kutularının esnek büyümesi */
    min-width: 120px;
}

#afad-filter {
    padding: 8px 15px;
    background: #2980b9; 
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

#afad-filter:hover {
    background: #3498db;
}

/* ==================================== */
/* 3. Harita Görünümü */
/* ==================================== */

#afad-map {
    height: 450px !important; 
    width: 98% !important; 
    margin: 20px auto !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
}

/* ==================================== */
/* 4. Tablo Görünümü (Estetik ve Anlaşılır) */
/* ==================================== */

#afad-table {
    width: 100%; /* Mobil sarıcı içinde tüm genişliği kaplasın */
    margin: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
    box-shadow: none; /* Sarıcıya taşıdık */
    font-size: 0.95em;
}

.table-responsive-wrapper {
    margin: 30px auto;
    width: 98%;
    border-radius: 8px;
    overflow-x: auto; /* Mobil için kaydırma çubuğu */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#afad-table thead tr {
    background: #e74c3c;
    color: white;
}

#afad-table th:first-child { border-top-left-radius: 8px; }
#afad-table th:last-child { border-top-right-radius: 8px; }

#afad-table th, 
#afad-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap; /* Yer adlarının kaymasını önle */
}

#afad-table th {
    font-weight: 700;
}

#afad-table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

#afad-table tbody tr:hover {
    background-color: #fceceb; 
    cursor: default;
}

/* Büyüklüğe Göre Renklendirme */
.mag-low { border-left: 5px solid #27ae60; }     /* Yeşil (M<3) */
.mag-medium { border-left: 5px solid #f39c12; }  /* Sarı (3-4.9) */
.mag-high { border-left: 5px solid #c0392b; }    /* Kırmızı (≥5) */


/* ==================================== */
/* 5. Mobil Uyum (Responsive) */
/* ==================================== */

@media (max-width: 768px) {
    #afad-app {
        padding: 5px;
    }

    .afad-title {
        font-size: 1.5em;
        padding: 12px;
    }

    #afad-controls {
        flex-direction: column; 
        align-items: stretch;
        gap: 10px;
        padding: 10px;
    }

    #afad-controls select,
    #afad-controls input[type="text"],
    #afad-filter {
        width: 100%; 
        box-sizing: border-box;
    }

    #afad-map {
        height: 300px !important;
    }

    /* Tablo kaydırmasını aktif et */
    #afad-table {
        min-width: 650px; 
    }
    
    #afad-table th, 
    #afad-table td {
        padding: 8px 6px;
        font-size: 0.8em;
    }
}