/* ==========================================================================
   KSK Construction - Popup Notification (Toast) System
   ========================================================================== */

:root {
    --toast-zindex: 999999;
    --toast-width: 380px;
    --toast-radius: 12px;
    --toast-shadow: 0 12px 32px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: var(--toast-zindex);
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
    width: var(--toast-width);
}

/* Individual Toast */
.toast-popup {
    pointer-events: auto;
    position: relative;
    background: #FFFFFF;
    border-radius: var(--toast-radius);
    box-shadow: var(--toast-shadow);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    padding: 16px 16px 18px 18px;
    gap: 14px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-left: 5px solid #64748B;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, margin-bottom 0.25s ease;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.toast-popup.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-popup.toast-hiding {
    transform: translateX(120%);
    opacity: 0;
}

/* Icon */
.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-top: 2px;
}

/* Content Area */
.toast-content {
    flex: 1;
    min-width: 0;
    padding-right: 6px;
}

.toast-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 4px;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.toast-message {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.45;
    word-break: break-word;
}

.toast-message ul {
    margin: 6px 0 0 16px;
    padding: 0;
    list-style-type: disc;
}

.toast-message li {
    margin-bottom: 3px;
    font-size: 0.85rem;
    color: #334155;
}

/* Close Button */
.toast-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 6px;
    transition: color 0.18s ease, background 0.18s ease;
    flex-shrink: 0;
    margin-top: -2px;
    margin-right: -4px;
}

.toast-close:hover {
    color: #0F172A;
    background: #F1F5F9;
}

/* Progress Bar Timer */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.08);
    transform-origin: left;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transition: width linear;
}

/* Pause on Hover */
.toast-popup:hover .toast-progress-bar {
    animation-play-state: paused;
}

/* ==========================================================================
   Type Variants
   ========================================================================== */

/* 1. SUCCESS - KSK Green Theme */
.toast-popup.toast-success {
    border-left-color: #2E7D32;
    background: linear-gradient(to right, #F4FBF5 0%, #FFFFFF 15%);
}
.toast-popup.toast-success .toast-icon {
    background: #E8F5E9;
    color: #2E7D32;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.15);
}
.toast-popup.toast-success .toast-title {
    color: #1B5E20;
}
.toast-popup.toast-success .toast-progress-bar {
    background: #2E7D32;
}

/* 2. ERROR - Crimson Theme */
.toast-popup.toast-error {
    border-left-color: #DC2626;
    background: linear-gradient(to right, #FEF2F2 0%, #FFFFFF 15%);
}
.toast-popup.toast-error .toast-icon {
    background: #FEE2E2;
    color: #DC2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}
.toast-popup.toast-error .toast-title {
    color: #991B1B;
}
.toast-popup.toast-error .toast-progress-bar {
    background: #DC2626;
}

/* 3. WARNING - Amber Theme */
.toast-popup.toast-warning {
    border-left-color: #D97706;
    background: linear-gradient(to right, #FFFBEB 0%, #FFFFFF 15%);
}
.toast-popup.toast-warning .toast-icon {
    background: #FEF3C7;
    color: #D97706;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15);
}
.toast-popup.toast-warning .toast-title {
    color: #92400E;
}
.toast-popup.toast-warning .toast-progress-bar {
    background: #D97706;
}

/* 4. INFO - KSK Teal Theme */
.toast-popup.toast-info {
    border-left-color: #1A4971;
    background: linear-gradient(to right, #F0F7FD 0%, #FFFFFF 15%);
}
.toast-popup.toast-info .toast-icon {
    background: #E0F2FE;
    color: #1A4971;
    box-shadow: 0 2px 8px rgba(26, 73, 113, 0.15);
}
.toast-popup.toast-info .toast-title {
    color: #113255;
}
.toast-popup.toast-info .toast-progress-bar {
    background: #1A4971;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 640px) {
    .toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: 100%;
    }

    .toast-popup {
        padding: 14px 14px 16px 14px;
        transform: translateY(-40px);
    }

    .toast-popup.toast-visible {
        transform: translateY(0);
    }

    .toast-popup.toast-hiding {
        transform: translateY(-40px);
    }
}
