/* ==========================================================================
   Endor CRM — Merkezi Bildirim & Diyalog Teması
   --------------------------------------------------------------------------
   Toastify.js ve SweetAlert2 için TEK override noktası.
   Renkler site.css içindeki --slate-* değişkenlerinden okunur; bu sayede
   açık/koyu tema geçişinde ayrıca bir şey yapmaya gerek kalmaz.

   Buraya dokunmadan önce: bildirimlerin görünümüyle ilgili başka hiçbir
   dosyada stil yok. Değişiklik burada yapılır.
   ========================================================================== */

/* NOT — fallback değerleri neden var:
   Views/Account/*.cshtml sayfaları Layout = null ile kendi HTML'ini yazıyor ve
   site.css'i YÜKLEMİYOR. Yani --slate-* değişkenleri o sayfalarda tanımsız.
   Bu yüzden her var() çağrısı .dark paletindeki değeri fallback olarak taşır;
   Account sayfaları zaten sabit koyu temada (#090d16). site.css yüklü olan
   normal sayfalarda fallback devreye girmez, tema değişkeni kazanır. */

/* ─────────────────────────────────────────────────────────────
   1) TOAST (Toastify.js)
   ───────────────────────────────────────────────────────────── */

/* Konum: sağ üst. Header h-16 (64px) olduğu için 4.5rem offset ile
   header'ın hemen altına oturur, topbar butonlarını kapatmaz. */
.toastify.endor-toast {
    top: 4.5rem;
    right: 1.25rem;

    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;

    display: flex;
    align-items: flex-start;
    gap: 0.6rem;

    min-width: 260px;
    max-width: 380px;
    padding: 0.7rem 0.85rem;

    border: 1px solid rgb(var(--slate-800, 30 41 59));
    border-left-width: 3px;
    border-radius: 0.75rem;

    background: rgb(var(--slate-900, 15 23 42) / 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgb(var(--slate-100, 241 245 249));

    box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
    cursor: default;
}

/* Toastify varsayılan gradient arka planını iptal et */
.toastify.endor-toast.on {
    background-image: none;
}

.endor-toast__body {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-width: 0;
}

.endor-toast__icon {
    flex: 0 0 auto;
    margin-top: 0.1rem;
    font-size: 0.85rem;
}

.endor-toast__text {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

/* Tipe göre vurgu rengi */
.toastify.endor-toast--success { border-left-color: #10b981; }
.toastify.endor-toast--success .endor-toast__icon { color: #10b981; }

.toastify.endor-toast--error { border-left-color: #ef4444; }
.toastify.endor-toast--error .endor-toast__icon { color: #f87171; }

.toastify.endor-toast--warning { border-left-color: #f59e0b; }
.toastify.endor-toast--warning .endor-toast__icon { color: #fbbf24; }

.toastify.endor-toast--info { border-left-color: #3b82f6; }
.toastify.endor-toast--info .endor-toast__icon { color: #60a5fa; }

/* Kapat butonu — tüm tiplerde var */
.toastify.endor-toast .toast-close {
    flex: 0 0 auto;
    align-self: flex-start;

    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    margin-left: 0.35rem;

    background: transparent;
    border: 0;
    border-radius: 0.35rem;

    color: rgb(var(--slate-500, 100 116 139));
    font-size: 0.7rem;
    line-height: 1;
    opacity: 1;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.toastify.endor-toast .toast-close:hover {
    color: rgb(var(--slate-200, 226 232 240));
    background: rgb(var(--slate-800, 30 41 59) / 0.6);
}

/* Mobil: tam genişlik */
@media (max-width: 640px) {
    .toastify.endor-toast {
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
        min-width: 0;
    }
}

/* ─────────────────────────────────────────────────────────────
   2) DİYALOG (SweetAlert2)
   ───────────────────────────────────────────────────────────── */

.swal2-container.endor-swal-container {
    z-index: 10050; /* header z-30, dropdown z-50, toast z-9999 üstünde */
}

.swal2-container.endor-swal-container .swal2-backdrop-show,
.swal2-container.endor-swal-container {
    background: rgb(2 6 15 / 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.swal2-popup.endor-swal {
    font-family: 'Outfit', sans-serif;
    width: 26rem;
    max-width: calc(100vw - 2rem);
    padding: 1.75rem 1.5rem 1.25rem;

    background: rgb(var(--slate-900, 15 23 42));
    border: 1px solid rgb(var(--slate-800, 30 41 59));
    border-radius: 1rem;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
    color: rgb(var(--slate-100, 241 245 249));
}

.swal2-popup.endor-swal .swal2-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    padding: 0;
    margin-bottom: 0.5rem;
    color: rgb(var(--slate-50, 248 250 252));
}

.swal2-popup.endor-swal .swal2-html-container {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.55;
    margin: 0;
    padding: 0;
    color: rgb(var(--slate-400, 148 163 184));
    overflow: hidden;
}

/* İkon halkası — SweetAlert2 varsayılanları fazla parlak, tona çekiyoruz */
.swal2-popup.endor-swal .swal2-icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0.25rem auto 1rem;
    border-width: 3px;
}

.swal2-popup.endor-swal .swal2-icon .swal2-icon-content {
    font-size: 1.75rem;
}

.swal2-popup.endor-swal .swal2-icon.swal2-error {
    border-color: rgb(239 68 68 / 0.45);
    color: #f87171;
}

.swal2-popup.endor-swal .swal2-icon.swal2-warning {
    border-color: rgb(245 158 11 / 0.45);
    color: #fbbf24;
}

.swal2-popup.endor-swal .swal2-icon.swal2-info,
.swal2-popup.endor-swal .swal2-icon.swal2-question {
    border-color: rgb(59 130 246 / 0.45);
    color: #60a5fa;
}

.swal2-popup.endor-swal .swal2-icon.swal2-success {
    border-color: rgb(16 185 129 / 0.45);
    color: #34d399;
}

.swal2-popup.endor-swal .swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #34d399;
}

.swal2-popup.endor-swal .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgb(16 185 129 / 0.35);
}

/* ── Butonlar ─────────────────────────────────────────────────
   DİKKAT: buttonsStyling:false kullanıldığı için SweetAlert2
   .swal2-styled sınıfını EKLEMİYOR. Stil bu yüzden kendi
   .endor-swal__btn sınıfımız üzerinden veriliyor
   (endor-notify.js → baseSwalOptions → customClass).
   ───────────────────────────────────────────────────────────── */

.swal2-popup.endor-swal .endor-swal__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 1.5rem 0 0;
    padding: 0;
}

.swal2-popup.endor-swal .endor-swal__btn {
    flex: 0 1 auto;
    min-width: 6.5rem;

    font-family: 'Outfit', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;

    padding: 0.65rem 1.25rem;
    margin: 0;

    border: 1px solid transparent;
    border-radius: 0.75rem;
    box-shadow: none;
    cursor: pointer;

    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.08s ease;
}

.swal2-popup.endor-swal .endor-swal__btn:focus {
    box-shadow: none;
    outline: none;
}

/* Halka yalnız klavye odağında — fare/otomatik odakta dolgulu butonun üstüne çift çerçeve binmesin */
.swal2-popup.endor-swal .endor-swal__btn:focus-visible {
    box-shadow: none;
    outline: 2px solid rgb(59 130 246 / 0.55);
    outline-offset: 2px;
}

.swal2-popup.endor-swal .endor-swal__btn:active {
    transform: translateY(1px);
}

/* Onay butonu — varsayılan (mavi) */
.swal2-popup.endor-swal .endor-swal__btn--confirm {
    background-color: #2563eb;
    color: #f8fafc;
    box-shadow: 0 6px 16px -8px rgb(37 99 235 / 0.9);
}

.swal2-popup.endor-swal .endor-swal__btn--confirm:hover {
    background-color: #3b82f6;
}

/* Yıkıcı işlem — kırmızı onay butonu */
.swal2-popup.endor-swal--danger .endor-swal__btn--confirm {
    background-color: #dc2626;
    color: #fef2f2;
    box-shadow: 0 6px 16px -8px rgb(220 38 38 / 0.9);
}

.swal2-popup.endor-swal--danger .endor-swal__btn--confirm:hover {
    background-color: #ef4444;
}

/* Uyarı — amber onay butonu */
.swal2-popup.endor-swal--warning .endor-swal__btn--confirm {
    background-color: #d97706;
    color: #fffbeb;
    box-shadow: 0 6px 16px -8px rgb(217 119 6 / 0.9);
}

.swal2-popup.endor-swal--warning .endor-swal__btn--confirm:hover {
    background-color: #f59e0b;
}

/* İptal butonu — ikincil, çerçeveli */
.swal2-popup.endor-swal .endor-swal__btn--cancel {
    background-color: transparent;
    border-color: rgb(var(--slate-700, 51 65 85));
    color: rgb(var(--slate-300, 203 213 225));
}

.swal2-popup.endor-swal .endor-swal__btn--cancel:hover {
    background-color: rgb(var(--slate-800, 30 41 59) / 0.7);
    border-color: rgb(var(--slate-600, 71 85 105));
    color: rgb(var(--slate-100, 241 245 249));
}

/* Dar ekran: butonlar alt alta, tam genişlik */
@media (max-width: 420px) {
    .swal2-popup.endor-swal .endor-swal__actions {
        flex-direction: column-reverse;
    }

    .swal2-popup.endor-swal .endor-swal__btn {
        width: 100%;
    }
}

/* Kapat (X) */
.swal2-popup.endor-swal .swal2-close {
    color: rgb(var(--slate-500, 100 116 139));
    font-size: 1.75rem;
    transition: color 0.15s ease;
}

.swal2-popup.endor-swal .swal2-close:hover {
    color: rgb(var(--slate-200, 226 232 240));
}

.swal2-popup.endor-swal .swal2-close:focus {
    box-shadow: none;
    outline: none;
}
