/**
 * Flipkart-Style E-Commerce Light Card Toast Notifications
 * Designed for My Digital Mart Front-Side Layouts
 */

.fk-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100% - 48px);
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (max-width: 576px) {
    .fk-toast-container {
        top: 16px;
        right: 16px;
        width: calc(100% - 32px);
    }
}

.fk-toast-card {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    padding: 14px 16px 14px 16px;
    animation: fkToastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
}

.fk-toast-card.fk-toast-hiding {
    animation: fkToastSlideOut 0.3s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

/* Left Accent Line (Flipkart Signature) */
.fk-toast-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.fk-toast-card.success::before { background-color: #26a541; }
.fk-toast-card.error::before { background-color: #ff6161; }
.fk-toast-card.warning::before { background-color: #ff9f00; }
.fk-toast-card.info::before { background-color: #2874f0; }

/* Icon Wrapper */
.fk-toast-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 12px;
    margin-top: 1px;
}

.fk-toast-card.success .fk-toast-icon-wrap {
    background-color: #e6f4ea;
    color: #26a541;
}

.fk-toast-card.error .fk-toast-icon-wrap {
    background-color: #fde8e8;
    color: #ff6161;
}

.fk-toast-card.warning .fk-toast-icon-wrap {
    background-color: #feedd3;
    color: #ff9f00;
}

.fk-toast-card.info .fk-toast-icon-wrap {
    background-color: #e8f0fe;
    color: #2874f0;
}

.fk-toast-icon-wrap svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Body Content */
.fk-toast-body {
    flex: 1;
    padding-right: 20px;
}

.fk-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #212121;
    line-height: 1.35;
    margin-bottom: 2px;
}

.fk-toast-text {
    font-size: 13px;
    color: #666666;
    line-height: 1.4;
    word-break: break-word;
}

/* Close Button */
.fk-toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #878787;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.fk-toast-close:hover {
    color: #212121;
    background: #f1f3f6;
}

.fk-toast-close svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Bottom Countdown Progress Bar */
.fk-toast-progress {
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 0;
    height: 3px;
    background: transparent;
}

.fk-toast-progress-bar {
    height: 100%;
    width: 100%;
    transition: width linear;
}

.fk-toast-card.success .fk-toast-progress-bar { background-color: #26a541; }
.fk-toast-card.error .fk-toast-progress-bar { background-color: #ff6161; }
.fk-toast-card.warning .fk-toast-progress-bar { background-color: #ff9f00; }
.fk-toast-card.info .fk-toast-progress-bar { background-color: #2874f0; }

/* Animations for Top Right Entry/Exit */
@keyframes fkToastSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-16px) translateX(20px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
}

@keyframes fkToastSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px) translateX(20px) scale(0.95);
    }
}
