﻿/* Masaüstü, Tablet ve Mobil Uyumlu Katman */
.sp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    /*transition: opacity 0.25s ease;*/
    transition: opacity 0.15s ease;
    padding: 20px;
    box-sizing: border-box;
}

    .sp-overlay.sp-show {
        opacity: 1;
    }

/* Popup Gövdesi */
.sp-box {
    background: #ffffff;
    background-image: linear-gradient(180deg, rgba(255, 159, 0, 0.30) 0%, rgba(255, 159, 0, 0.05) 35%, #ffffff 65%);
    padding: 32px;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-sizing: border-box;
    /* İnce siyah/gri geçişli sınır çizgisi */
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
    transform: scale(0.85);
    /*transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);*/
    transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.sp-overlay.sp-show .sp-box {
    transform: scale(1);
}

/* SVG İkon Taşıyıcı ve Tür Renkleri */
.sp-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-box.success {
    border-bottom: 6px solid #10b981;
}

.sp-box.error {
    border-bottom: 6px solid #ef4444;
}

.sp-box.warning {
    border-bottom: 6px solid #f59e0b;
}

.sp-box.question {
    border-bottom: 6px solid #3b82f6;
}

/* Yazı Alanları (\n desteği için white-space ayarı kritik) */
.sp-title {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 24px; /* Biraz daha büyütüldü */
    font-weight: 800; /* Ekstra kalınlaştırıldı */
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

/* --- Türlere Göre Dinamik Başlık (Title) Renkleri --- */
.sp-box.success .sp-title {
    color: #10b981;
}

.sp-box.error .sp-title {
    color: #ef4444;
}

.sp-box.warning .sp-title {
    color: #d97706;
}

.sp-box.question .sp-title {
    color: #3b82f6;
}



.sp-message {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #475569;
    margin-bottom: 28px;
    line-height: 1.6;
    white-space: pre-line;
    text-align: center;
}

/* Buton Grubu - Mobil ve Tablette Esnek Yerleşim */
.sp-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px; /* Alt çizgiyle arasına mesafe */
}

.sp-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 100px;
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

    .sp-btn:active {
        transform: scale(0.97);
    }

/* --- Türlere Göre Dinamik Buton Renkleri (Hata ve Uyarı Mavi Kalmıyor) --- */
.sp-box.success .sp-btn-confirm, .sp-btn-success {
    background: #10b981;
    color: #fff;
}

    .sp-box.success .sp-btn-confirm:hover {
        background: #059669;
    }

.sp-box.error .sp-btn-confirm {
    background: #ef4444;
    color: #fff;
}

    .sp-box.error .sp-btn-confirm:hover {
        background: #dc2626;
    }

.sp-box.warning .sp-btn-confirm {
    background: #f59e0b;
    color: #fff;
}

    .sp-box.warning .sp-btn-confirm:hover {
        background: #d97706;
    }

.sp-box.question .sp-btn-confirm, .sp-btn-confirm {
    background: #3b82f6;
    color: #fff;
}

    .sp-box.question .sp-btn-confirm:hover {
        background: #2563eb;
    }

/* Diğer yardımcı butonlar */
.sp-btn-deny {
    background: #ef4444;
    color: #fff;
}

    .sp-btn-deny:hover {
        background: #dc2626;
    }

.sp-btn-cancel {
    background: #94a3b8;
    color: #fff;
}

    .sp-btn-cancel:hover {
        background: #64748b;
    }

/* --- SVG Çizim Animasyonları --- */
/* ==========================================================================
   AKILLI SVG ANIMASYONLARI (Sadece Popup Açıldığında Başlar ve Devam Eder)
   ========================================================================== */

/* Çizgilerin başlangıçta gizli (çizilmemiş) kalmasını sağlıyoruz */
.svg-animate path, .svg-animate circle {
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
}

/* OKU / TETİKLE: Popup tamamen açıldığında (.sp-show geldiğinde) çizim animasyonunu başlat */
.sp-overlay.sp-show .svg-animate path,
.sp-overlay.sp-show .svg-animate circle {
    /* 160 piksel boyunca tam tur çizer ve uçlar eksiksiz birleşir */
    animation: draw 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

/* Çizim bittikten sonra İkon Taşıyıcısının sürekli hafifçe nabız gibi atması (Pulse) */
/* Hem success hem error hem de warning için sürekli hareket sağlar */
.sp-overlay.sp-show .sp-icon-wrapper {
    /* 2 saniyede bir sürekli yumuşakça büyüyüp küçülür */
    animation: spIconPulse 1s infinite ease-in-out 0.6s;
}

/* Çizim CSS Keyframe */
@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Sürekli Nabız (Pulse) Animasyonu */
@keyframes spIconPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
    /* Gözü yormayacak elit bir büyüme oranı */
}

/* Warning Üçgeni İçin Ekstra Canlılık (Kendi içinde de sürekli sarsılsın) */
.svg-pulse {
    animation: warningWobble 2s infinite ease-in-out;
}

@keyframes warningWobble {
    0%, 100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-3deg);
    }

    75% {
        transform: rotate(3deg);
    }
}


/* --- İmza Üstü Şık HR Çizgisi --- */
.sp-box hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 20px 0 10px 0;
}

/* --- Powered By Panatek - İmza Alanı --- */
.sp-footer-signature {
    font-family: 'Georgia', 'Apple Chancery', 'Comic Sans MS', cursive, sans-serif;
    font-size: 13px;
    font-style: italic;
    font-weight: 700;
    text-align: right;
    letter-spacing: 0.5px;
    user-select: none;
    transition: color 0.3s ease;
}

/* --- Mesaj Türlerine Göre Dinamik Renkler --- */

/* Mesaj Türlerine Göre İmza Renkleri (Uyumlu kalması için) */
.sp-box.success .sp-footer-signature {
    color: #10b981;
}

.sp-box.error .sp-footer-signature {
    color: #ef4444;
}

.sp-box.warning .sp-footer-signature {
    color: #d97706;
}

.sp-box.question .sp-footer-signature {
    color: #3b82f6;
}
