/**
 * Premium Toast Notifications v1.0
 * Ultra modern ve havalı bildirimler
 * 
 * @author Ömer Berat Keser
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

/* Toast Base */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-width: 350px;
    max-width: 450px;
    padding: 20px 25px;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(99, 102, 241, 0.1);
    pointer-events: auto;
    animation: toastSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Animated top border */
.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--toast-accent);
}

/* Sliding animation for top border */
.toast::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: toastShine 2s ease-in-out infinite;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
}

@keyframes toastShine {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

/* Toast Icon */
.toast-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    background: var(--toast-icon-bg);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.toast-message {
    font-size: 14px;
    color: #a0aec0;
    line-height: 1.5;
}

/* Toast Close Button */
.toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--toast-accent);
    animation: toastProgress var(--toast-duration, 5s) linear forwards;
    opacity: 0.7;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ==================== SUCCESS TOAST ==================== */
.toast.toast-success {
    --toast-accent: linear-gradient(90deg, #10b981, #34d399);
    --toast-icon-bg: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.toast.toast-success::before {
    background: var(--toast-accent);
}

.toast.toast-success .toast-icon {
    color: #10b981;
}

.toast.toast-success .toast-title {
    color: #34d399;
}

/* Success Icon Animation */
.toast.toast-success .toast-icon::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    animation: successRipple 1.5s ease-out infinite;
}

@keyframes successRipple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ==================== ERROR TOAST ==================== */
.toast.toast-error {
    --toast-accent: linear-gradient(90deg, #ef4444, #f87171);
    --toast-icon-bg: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast.toast-error::before {
    background: var(--toast-accent);
}

.toast.toast-error .toast-icon {
    color: #ef4444;
    animation: iconShake 0.5s ease-in-out;
}

@keyframes iconShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

.toast.toast-error .toast-title {
    color: #f87171;
}

/* ==================== WARNING TOAST ==================== */
.toast.toast-warning {
    --toast-accent: linear-gradient(90deg, #f59e0b, #fbbf24);
    --toast-icon-bg: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.toast.toast-warning::before {
    background: var(--toast-accent);
}

.toast.toast-warning .toast-icon {
    color: #f59e0b;
    animation: iconWarn 1s ease-in-out infinite;
}

@keyframes iconWarn {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.toast.toast-warning .toast-title {
    color: #fbbf24;
}

/* ==================== LOCKED TOAST (BAN) ==================== */
.toast.toast-locked {
    --toast-accent: linear-gradient(90deg, #dc2626, #991b1b);
    --toast-icon-bg: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.5);
    background: rgba(30, 10, 10, 0.95);
}

.toast.toast-locked::before {
    background: var(--toast-accent);
    animation: lockedPulse 1s ease-in-out infinite;
}

@keyframes lockedPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.toast.toast-locked .toast-icon {
    color: #dc2626;
    font-size: 28px;
    animation: lockedShake 0.5s ease-in-out;
}

@keyframes lockedShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.toast.toast-locked .toast-title {
    color: #f87171;
}

/* Remaining Attempts Badge */
.remaining-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fca5a5;
}

.remaining-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

.remaining-badge i {
    font-size: 10px;
}

/* Timer Badge */
.timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 14px;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fca5a5;
}

.timer-badge i {
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .toast-container {
        top: 15px;
        right: 15px;
        left: 15px;
    }

    .toast {
        min-width: auto;
        max-width: none;
        padding: 16px 20px;
    }

    .toast-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}
