/**
 * Shopimo Global Notification (Toast) System CSS
 *
 * Reusable, premium glassmorphic toast notification styling.
 * Responsive positioning:
 * - Desktop (>1024px): Top Right Corner
 * - Tablet (768px - 1024px): Bottom Right Corner
 * - Mobile (<768px): Bottom Center
 *
 * @package Shopimo
 * @since 1.2.0
 */

/* ==========================================================================
   1. GLOBAL TOAST CONTAINER
   ========================================================================== */
#shopimo-toast-container {
    position: fixed;
    z-index: 999999;
    display: flex;
    gap: 12px;
    pointer-events: none;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Position: Desktop (> 1024px) */
@media (min-width: 1025px) {
    #shopimo-toast-container {
        top: 24px;
        right: 24px;
        bottom: auto;
        left: auto;
        flex-direction: column;
        align-items: flex-end;
        width: 380px;
    }
}

/* Position: Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    #shopimo-toast-container {
        top: auto;
        bottom: 24px;
        right: 24px;
        left: auto;
        flex-direction: column-reverse;
        align-items: flex-end;
        width: 360px;
    }
}

/* Position: Mobile (< 768px) */
@media (max-width: 767px) {
    #shopimo-toast-container {
        top: auto;
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-direction: column-reverse;
        align-items: center;
        width: calc(100% - 32px);
        max-width: 420px;
    }
}

/* ==========================================================================
   2. TOAST ITEM CARD
   ========================================================================== */
.shopimo-toast-item {
    pointer-events: auto;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.12),
                0 4px 12px -2px rgba(15, 23, 42, 0.06),
                0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                margin 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    will-change: transform, opacity;
}

/* Entrance Animations per device breakpoint */
@media (min-width: 1025px) {
    .shopimo-toast-item {
        transform: translateY(-16px) scale(0.96);
    }
    .shopimo-toast-item.shopimo-toast-show {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    .shopimo-toast-item.shopimo-toast-hide {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

@media (max-width: 1024px) {
    .shopimo-toast-item {
        transform: translateY(16px) scale(0.96);
    }
    .shopimo-toast-item.shopimo-toast-show {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    .shopimo-toast-item.shopimo-toast-hide {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* ==========================================================================
   3. CONTENT LAYOUT
   ========================================================================== */
.shopimo-toast-content {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Icon Badge */
.shopimo-toast-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    box-sizing: border-box;
}

/* Text Wrapper */
.shopimo-toast-text {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.shopimo-toast-title {
    font-family: var(--wpr-font-display, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin: 0 0 3px 0;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shopimo-toast-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
    margin-left: 6px;
    line-height: 1.4;
}

.shopimo-toast-message {
    font-family: var(--wpr-font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 13px;
    font-weight: 400;
    color: #475569;
    line-height: 1.4;
    margin: 0;
    word-break: break-word;
}

.shopimo-toast-message a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* Close Button */
.shopimo-toast-close-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 15px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
    padding: 0;
}

.shopimo-toast-close-btn:hover,
.shopimo-toast-close-btn:focus-visible {
    color: #0f172a;
    background-color: rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   4. TYPE COLOR THEMES
   ========================================================================== */

/* Success */
.shopimo-toast-success .shopimo-toast-icon-badge {
    background-color: rgba(5, 150, 105, 0.12);
    color: #059669;
}
.shopimo-toast-success .shopimo-toast-progress-bar {
    background-color: #059669;
}

/* Error */
.shopimo-toast-error .shopimo-toast-icon-badge {
    background-color: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}
.shopimo-toast-error .shopimo-toast-progress-bar {
    background-color: #dc2626;
}

/* Warning */
.shopimo-toast-warning .shopimo-toast-icon-badge {
    background-color: rgba(217, 119, 6, 0.12);
    color: #d97706;
}
.shopimo-toast-warning .shopimo-toast-progress-bar {
    background-color: #d97706;
}

/* Info */
.shopimo-toast-info .shopimo-toast-icon-badge {
    background-color: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}
.shopimo-toast-info .shopimo-toast-progress-bar {
    background-color: #2563eb;
}

/* ==========================================================================
   5. PROGRESS BAR & ANIMATION
   ========================================================================== */
.shopimo-toast-progress-track {
    height: 3px;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.05);
    overflow: hidden;
    position: relative;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.shopimo-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    animation: shopimo-toast-progress linear forwards;
}

/* Desktop Hover Pause */
@media (hover: hover) and (pointer: fine) {
    .shopimo-toast-item:hover .shopimo-toast-progress-bar {
        animation-play-state: paused !important;
    }
}

@keyframes shopimo-toast-progress {
    0% {
        transform: scaleX(1);
    }
    100% {
        transform: scaleX(0);
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .shopimo-toast-item {
        transition: opacity 0.15s linear !important;
        transform: none !important;
    }
    .shopimo-toast-item.shopimo-toast-show {
        opacity: 1 !important;
        transform: none !important;
    }
    .shopimo-toast-item.shopimo-toast-hide {
        opacity: 0 !important;
        transform: none !important;
    }
    .shopimo-toast-progress-bar {
        animation: none !important;
        display: none !important;
    }
}
