/**
 * SweetAlert2 Merkezi Tema Dosyası
 * Tüm SweetAlert buton renkleri buradan yönetilir
 * 
 * KURALLAR:
 * - Onay/İşlem butonları (confirm): Yeşil (#10B981)
 * - İptal/Kapat butonları (cancel): Kırmızı (#EF4444)
 * - Tek butonlu modallerde (sadece kapat): Kırmızı (#EF4444)
 */

/* ===== TEMEL BUTON RENKLERİ ===== */

/* Onay/İşlem Butonu - Yeşil */
.swal2-confirm {
    background-color: #10B981 !important;
    color: white !important;
    border: none !important;
    transition: background-color 0.2s ease !important;
}

.swal2-confirm:hover {
    background-color: #059669 !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4) !important;
}

/* İptal/Kapat Butonu - Kırmızı */
.swal2-cancel {
    background-color: #EF4444 !important;
    color: white !important;
    border: none !important;
    transition: background-color 0.2s ease !important;
}

.swal2-cancel:hover {
    background-color: #DC2626 !important;
}

.swal2-cancel:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4) !important;
}

/* ===== TEK BUTONLU MODALLAR (SADECE KAPAT) ===== */

/* Tek butonlu modallar - kapat butonu kırmızı */
.swal2-popup.swal-single-close .swal2-confirm,
.swal2-popup.swal-single-close .swal2-styled.swal2-confirm,
.swal-single-close .swal2-confirm {
    background-color: #EF4444 !important;
    color: white !important;
}

.swal2-popup.swal-single-close .swal2-confirm:hover,
.swal2-popup.swal-single-close .swal2-styled.swal2-confirm:hover,
.swal-single-close .swal2-confirm:hover {
    background-color: #DC2626 !important;
}

.swal2-popup.swal-single-close .swal2-confirm:focus,
.swal-single-close .swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4) !important;
}

/* ===== DUYURU MODALI ===== */

.swal2-announcement {
    background-color: #FFFFFF !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
}

/* body + container: SweetAlert2 / Material UI enjekte stillerinden daha yüksek özgüllük */
body .swal2-container .swal2-popup.swal2-announcement .swal2-title.swal2-announcement-title,
body .swal2-container .swal2-popup.swal2-announcement .swal2-header .swal2-title.swal2-announcement-title {
    color: #1F2937 !important;
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
    margin-top: 0.75rem !important;
    padding-top: 0.5rem !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Sınıf tek başına (geri uyumluluk) */
.swal2-announcement-title {
    color: #1F2937 !important;
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
    margin-top: 0.75rem !important;
    padding-top: 0.5rem !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Gövde metni — başlığın hemen altında (#swal2-html-container içindeki ilk blok) */
.swal2-announcement-body {
    color: #4B5563 !important;
}

/* Eski sınıf adı (geri uyumluluk) */
.swal2-announcement-content {
    color: #4B5563 !important;
}

/* HTML sarmalayıcı: gövde ortada, başlığa yakın (temanın büyük üst margin’ini düşürür) */
.swal2-popup.swal2-announcement .swal2-html-container.swal2-announcement-html-wrap {
    text-align: center !important;
    margin: 0.2rem 1.6em 0.3em !important;
    padding-top: 0 !important;
}

@media (max-width: 639px) {
    body .swal2-container .swal2-popup.swal2-announcement .swal2-title.swal2-announcement-title,
    body .swal2-container .swal2-popup.swal2-announcement .swal2-header .swal2-title.swal2-announcement-title,
    .swal2-popup.swal2-announcement .swal2-announcement-title {
        font-size: 1.125rem !important;
    }
}

/* ===== GENEL STİLLER ===== */

/* Buton boyutları */
.swal2-confirm,
.swal2-cancel {
    font-size: 0.95rem !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: 0.5rem !important;
    font-weight: 500 !important;
}

/* Popup köşeleri */
.swal2-popup {
    border-radius: 0.75rem !important;
}

/* ===== WHATSAPP & WİFİ MODALLARI — Duyuru ile aynı responsive, taşma kesin çözüm ===== */
/* Container: yatay taşmayı kes (tema grid + 32em popup mobilde taşıyor) */
.swal2-container {
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}
/* WhatsApp/WiFi açıkken container padding (:has() destekleyen tarayıcılar) */
@supports selector(:has(.swal2-popup)) {
    .swal2-container:has(.swal2-popup.swal-menu-modal) {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Popup: genişlik her zaman viewport içinde (tema 32em + max-width:100% grid’te taşabiliyor) */
.swal2-popup.swal-menu-modal {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 32rem !important;
    padding: 1.25rem !important;
}

/* Mobil (640px altı): viewport’u aşmaması için sabit hesaplı genişlik */
@media (max-width: 639px) {
    .swal2-container:has(.swal2-popup.swal-menu-modal) {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .swal2-popup.swal-menu-modal {
        width: calc(100vw - 1.5rem) !important;
        max-width: calc(100vw - 1.5rem) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Duyuru ile aynı başlık/içerik/buton stilleri */
.swal-menu-modal-title {
    color: #1F2937 !important;
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
}

.swal-menu-modal-content {
    color: #4B5563 !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
    text-align: center !important;
}

.swal-menu-modal-actions {
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
}

.swal-menu-modal-actions .swal2-confirm,
.swal-menu-modal-actions .swal2-cancel {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 639px) {
    .swal2-popup.swal-menu-modal .swal-menu-modal-title {
        font-size: 1.125rem !important;
    }
    .swal2-popup.swal-menu-modal .swal-menu-modal-content {
        font-size: 0.875rem !important;
    }
}

/* İkon kenarlığını kaldır */
.swal2-icon.no-border {
    border: none !important;
}

/* ===== REAKSİYON / TOAST BİLDİRİMLERİ (Merkezi tema ile aynı) ===== */
/* Toast'ta overlay/backdrop ve blur olmasın */
.swal2-container:has(.swal-menu-toast) .swal2-backdrop {
    display: none !important;
}

.swal2-container:has(.swal-menu-toast) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.swal-menu-toast.swal2-toast {
    border-radius: 0.75rem !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
    padding: 0.75rem 1rem !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.swal-menu-toast.swal2-toast .swal2-success {
    border-color: #10B981 !important;
    color: #10B981 !important;
}

.swal-menu-toast .swal2-success [class^='swal2-success-line'],
.swal-menu-toast .swal2-success .swal2-icon-content {
    background-color: #10B981 !important;
}

.swal-menu-toast .swal2-error {
    border-color: #EF4444 !important;
    color: #EF4444 !important;
}

.swal-menu-toast .swal2-error [class^='swal2-x-mark-line'],
.swal-menu-toast .swal2-error .swal2-icon-content {
    background-color: #EF4444 !important;
}

/* Popup sınıfı ile (toast hem .swal2-toast hem .swal2-popup) */
.swal2-popup.swal-menu-toast {
    border-radius: 0.75rem !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
    padding: 0.75rem 1rem !important;
}

.swal-menu-toast.swal2-icon-success .swal2-icon {
    border-color: #10B981 !important;
    color: #10B981 !important;
}

.swal-menu-toast.swal2-icon-success .swal2-icon .swal2-icon-content {
    color: #10B981 !important;
}

.swal-menu-toast.swal2-icon-error .swal2-icon {
    border-color: #EF4444 !important;
    color: #EF4444 !important;
}

.swal-menu-toast.swal2-icon-error .swal2-icon .swal2-icon-content {
    color: #EF4444 !important;
}

.swal-menu-toast .swal2-title {
    color: #1F2937 !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
}

.swal-menu-toast .swal2-timer-progress-bar {
    background: linear-gradient(to right, #10B981, #059669) !important;
}
