/* ===========================================================
   GosbİK Toast Bildirim Sistemi
   Hem ön yüz (body.dark-theme) hem admin (body[data-theme="dark"])
   temalarında çalışır. Renkler bilinçli olarak sabittir; iki panelin
   CSS değişken isimleri farklı olduğu için burada kendi paletini taşır.
   =========================================================== */

.gos-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 380px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.gos-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 40px 14px 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--toast-accent, #6b7280);
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.gos-toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Kapanırken sağa değil yukarı kayarak çıkar — altındakiler yumuşak toparlanır */
.gos-toast.hiding {
    opacity: 0;
    transform: translateX(120%);
}

.gos-toast-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #ffffff;
    background-color: var(--toast-accent, #6b7280);
}

.gos-toast-body {
    flex-grow: 1;
    min-width: 0;
}

.gos-toast-title {
    margin: 0 0 2px;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.3;
    color: #111827;
}

.gos-toast-message {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #4b5563;
    word-wrap: break-word;
}

.gos-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: none;
    color: #9ca3af;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gos-toast-close:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #111827;
}

/* Otomatik kapanma sayacı */
.gos-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background-color: var(--toast-accent, #6b7280);
    opacity: 0.45;
    transform-origin: left center;
    animation: gos-toast-countdown linear forwards;
}

@keyframes gos-toast-countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Fareyle üzerine gelince sayaç durur — kullanıcı okumayı bitirsin */
.gos-toast:hover .gos-toast-progress {
    animation-play-state: paused;
}

/* ---- Tipler ---- */
.gos-toast-success { --toast-accent: #16a34a; }
.gos-toast-error   { --toast-accent: #dc2626; }
.gos-toast-warning { --toast-accent: #d97706; }
.gos-toast-info    { --toast-accent: #2563eb; }

/* ---- Karanlık tema (ön yüz ve admin) ---- */
body.dark-theme .gos-toast,
body[data-theme="dark"] .gos-toast {
    background-color: #1b2233;
    border-color: #2b3448;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

body.dark-theme .gos-toast-title,
body[data-theme="dark"] .gos-toast-title {
    color: #f8fafc;
}

body.dark-theme .gos-toast-message,
body[data-theme="dark"] .gos-toast-message {
    color: #cbd5e1;
}

body.dark-theme .gos-toast-close:hover,
body[data-theme="dark"] .gos-toast-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

/* ---- Mobil: tam genişlik, üstten iner ---- */
@media (max-width: 575.98px) {
    .gos-toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}

/* Hareket azaltma tercihi olan kullanıcılar için animasyonsuz sunum */
@media (prefers-reduced-motion: reduce) {
    .gos-toast {
        transition: opacity 0.2s ease;
        transform: none;
    }
    .gos-toast.show,
    .gos-toast.hiding {
        transform: none;
    }
    .gos-toast-progress {
        animation: none;
    }
}
