/**
 * TRINEX TOAST v2.0 - CSS
 * Dedem için şaşalı toast tasarımı
 */

:root {
    --toast-width: 400px;
    --toast-bg: rgba(255, 255, 255, 0.98);
    --toast-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    --toast-border-radius: 16px;
}

/* Container */
#toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
}

/* Ana Toast */
.trinex-toast {
    width: var(--toast-width);
    background: var(--toast-bg);
    border-radius: var(--toast-border-radius);
    box-shadow: var(--toast-shadow);
    display: flex;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: auto;
    /* Giriş animasyonu */
    transform: translateX(120%) scale(0.8);
    opacity: 0;
    animation: toastEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Giriş Animasyonu */
@keyframes toastEnter {
    0% {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Çıkış Animasyonu */
.trinex-toast.hiding {
    animation: toastExit 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toastExit {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(120%) scale(0.8);
        opacity: 0;
    }
}

/* Sol Renk Şeridi */
.trinex-toast-stripe {
    width: 6px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

    .trinex-toast-stripe::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: inherit;
        animation: stripeShine 2s ease-in-out infinite;
    }

@keyframes stripeShine {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* İkon Bölümü */
.trinex-toast-icon-wrapper {
    padding: 20px 0 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trinex-toast-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

    /* İkon Parlama Efekti */
    .trinex-toast-icon-box::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient( 45deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60% );
        animation: iconShine 3s ease-in-out infinite;
    }

@keyframes iconShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* İkon Pulse Animasyonu */
.trinex-toast-icon-box i {
    position: relative;
    z-index: 1;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* İçerik Bölümü */
.trinex-toast-content {
    flex: 1;
    padding: 18px 50px 18px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.trinex-toast-title {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.trinex-toast-message {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    font-weight: 400;
}

/* Kapat Butonu */
.trinex-toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .trinex-toast-close:hover {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
        transform: rotate(90deg) scale(1.1);
    }

/* Progress Bar */
.trinex-toast-progress-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.trinex-toast-progress {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: progressShrink linear forwards;
    position: relative;
}

    .trinex-toast-progress::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.4), transparent );
        animation: progressShine 1.5s ease-in-out infinite;
    }

@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   TEMA - SUCCESS (Yeşil)
   ============================================ */
.trinex-toast.success .trinex-toast-stripe {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.trinex-toast.success .trinex-toast-icon-box {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
}

.trinex-toast.success .trinex-toast-progress {
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
    background-size: 200% 100%;
    animation: progressShrink linear forwards, progressGradient 2s linear infinite;
}

.trinex-toast.success .trinex-toast-title {
    color: #047857;
}

/* ============================================
   TEMA - ERROR (Kırmızı)
   ============================================ */
.trinex-toast.error .trinex-toast-stripe {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.trinex-toast.error .trinex-toast-icon-box {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
}

.trinex-toast.error .trinex-toast-progress {
    background: linear-gradient(90deg, #ef4444, #f87171, #ef4444);
    background-size: 200% 100%;
    animation: progressShrink linear forwards, progressGradient 2s linear infinite;
}

.trinex-toast.error .trinex-toast-title {
    color: #dc2626;
}

/* Hata için titreme efekti */
.trinex-toast.error {
    animation: toastEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, toastShake 0.5s ease-in-out 0.6s;
}

@keyframes toastShake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

/* ============================================
   TEMA - WARNING (Turuncu)
   ============================================ */
.trinex-toast.warning .trinex-toast-stripe {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.trinex-toast.warning .trinex-toast-icon-box {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
}

.trinex-toast.warning .trinex-toast-progress {
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    background-size: 200% 100%;
    animation: progressShrink linear forwards, progressGradient 2s linear infinite;
}

.trinex-toast.warning .trinex-toast-title {
    color: #d97706;
}

/* Uyarı için attention efekti */
.trinex-toast.warning .trinex-toast-icon-box i {
    animation: iconPulse 0.8s ease-in-out infinite;
}

/* ============================================
   TEMA - INFO (Mavi)
   ============================================ */
.trinex-toast.info .trinex-toast-stripe {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.trinex-toast.info .trinex-toast-icon-box {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
}

.trinex-toast.info .trinex-toast-progress {
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    background-size: 200% 100%;
    animation: progressShrink linear forwards, progressGradient 2s linear infinite;
}

.trinex-toast.info .trinex-toast-title {
    color: #2563eb;
}

/* Progress gradient animasyonu */
@keyframes progressGradient {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* ============================================
   HOVER EFEKTİ
   ============================================ */
.trinex-toast:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.18), 0 10px 30px rgba(0, 0, 0, 0.12);
}

    .trinex-toast:hover .trinex-toast-progress {
        animation-play-state: paused;
    }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    :root {
        --toast-width: calc(100vw - 40px);
    }

    #toast-container {
        top: 15px;
        right: 20px;
        left: 20px;
    }

    .trinex-toast-icon-box {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .trinex-toast-content {
        padding: 14px 45px 14px 14px;
    }

    .trinex-toast-title {
        font-size: 14px;
    }

    .trinex-toast-message {
        font-size: 12px;
    }
}
