/**
 * Toast Notifications Styles
 * Modern, polished toast notification system for WooCommerce
 *
 * @package VoltRide
 * @version 2.0
 */

/* ============================================
   Toast Container
   ============================================ */
#voltride-toast-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

/* ============================================
   Individual Toast
   ============================================ */
.voltride-toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(15, 63, 54, 0.04),
        0 4px 12px rgba(15, 63, 54, 0.08),
        0 8px 32px rgba(15, 63, 54, 0.06);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease,
        box-shadow 0.2s ease;
}

.voltride-toast:hover {
    box-shadow:
        0 0 0 1px rgba(15, 63, 54, 0.06),
        0 6px 16px rgba(15, 63, 54, 0.1),
        0 12px 40px rgba(15, 63, 54, 0.08);
}

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

.voltride-toast--dismissing {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 1, 1),
        opacity 0.2s ease;
}

/* ============================================
   Toast Icon
   ============================================ */
.voltride-toast__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.voltride-toast__icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* ============================================
   Toast Message
   ============================================ */
.voltride-toast__message {
    flex: 1;
    font-family: 'Biryani', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--new-green, #0F3F36);
    letter-spacing: -0.01em;
}

/* ============================================
   Close Button
   ============================================ */
.voltride-toast__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #9CA3AF;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
    margin-right: -4px;
}

.voltride-toast__close:hover {
    background: rgba(15, 63, 54, 0.06);
    color: var(--new-green, #0F3F36);
}

.voltride-toast__close:active {
    transform: scale(0.92);
}

.voltride-toast__close svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Progress Bar
   ============================================ */
.voltride-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: transparent;
    transform-origin: left;
    transform: scaleX(1);
    border-radius: 0 0 14px 14px;
}

.voltride-toast__progress--active {
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ============================================
   Toast Types - Success
   ============================================ */
.voltride-toast--success {
    background: #E8F5F1;
}

.voltride-toast--success .voltride-toast__icon {
    background: var(--new-green, #0F3F36);
    color: #FFFFFF;
}

.voltride-toast--success .voltride-toast__progress {
    background: linear-gradient(90deg, var(--new-green, #0F3F36), rgba(15, 63, 54, 0.3));
}

/* ============================================
   Toast Types - Error
   ============================================ */
.voltride-toast--error {
    background: #FDEAEA;
}

.voltride-toast--error .voltride-toast__icon {
    background: var(--sales-red, #B1292B);
    color: #FFFFFF;
}

.voltride-toast--error .voltride-toast__progress {
    background: linear-gradient(90deg, var(--sales-red, #B1292B), rgba(177, 41, 43, 0.3));
}

/* ============================================
   Toast Types - Info
   ============================================ */
.voltride-toast--info {
    background: #FFF0F3;
}

.voltride-toast--info .voltride-toast__icon {
    background: linear-gradient(135deg, var(--volt-pink-dark, #FF6082) 0%, #E85070 100%);
    color: #FFFFFF;
}

.voltride-toast--info .voltride-toast__progress {
    background: linear-gradient(90deg, var(--volt-pink-dark, #FF6082), rgba(255, 96, 130, 0.3));
}

/* ============================================
   Hide Original WooCommerce Notices
   ============================================ */
body.voltride-toasts-active .woocommerce-notices-wrapper,
body.voltride-toasts-active .woocommerce-message,
body.voltride-toasts-active .woocommerce-error:not(.voltride-toast--error),
body.voltride-toasts-active .woocommerce-info:not(.voltride-toast--info) {
    display: none !important;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    #voltride-toast-container {
        top: auto;
        bottom: 24px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .voltride-toast {
        transform: translateY(calc(100% + 24px));
        padding: 12px 14px;
        gap: 12px;
        border-radius: 12px;
    }

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

    .voltride-toast--dismissing {
        transform: translateY(calc(100% + 24px));
    }

    .voltride-toast__icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .voltride-toast__icon svg {
        width: 16px;
        height: 16px;
    }

    .voltride-toast__message {
        font-size: 12px;
    }

    .voltride-toast__close {
        width: 26px;
        height: 26px;
    }

    .voltride-toast__close svg {
        width: 12px;
        height: 12px;
    }

    .voltride-toast__progress {
        border-radius: 0 0 12px 12px;
    }
}

/* ============================================
   Reduce Motion for Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .voltride-toast {
        transition: opacity 0.2s ease;
        transform: none !important;
    }

    .voltride-toast--visible {
        transform: none !important;
    }

    .voltride-toast--dismissing {
        transform: none !important;
    }

    .voltride-toast__progress--active {
        animation: none;
        transform: scaleX(0);
    }

    .voltride-toast__close:active {
        transform: none;
    }
}
