/**
 * Global Toast Notification Styles
 * Modern toast notifications for WooCommerce and custom messages
 * 
 * @package Modeo
 */

/* Toast Container */
.modeo-toast-container {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 10000000 !important; /* Higher than cart drawer (100000) and mega menu (9999999) to ensure toasts are always visible above everything */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

@media (max-width: 640px) {
    .modeo-toast-container {
        top: 4rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* Toast Base Styles */
.modeo-toast {
    position: relative;
    display: flex !important;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #ffffff !important;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.25), 0 8px 16px -8px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #e5e7eb !important;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
    max-width: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modeo-toast--show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast Icon */
.modeo-toast__icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.125rem;
}

.modeo-toast__icon svg {
    width: 100%;
    height: 100%;
}

/* Toast Message */
.modeo-toast__message {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #171717 !important;
    font-weight: 500;
    min-width: 0;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

/* Toast Actions */
.modeo-toast__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.modeo-toast__action {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.modeo-toast__action:hover {
    opacity: 0.8;
}

/* Toast Close Button */
.modeo-toast__close {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    margin-top: -0.25rem;
    margin-right: -0.25rem;
}

.modeo-toast__close:hover {
    background: #f3f4f6;
    color: #171717;
}

.modeo-toast__close svg {
    width: 1rem;
    height: 1rem;
}

/* Toast Types */
.modeo-toast--success {
    background: #f0fdf4 !important; /* green-50 */
    border-left: 4px solid #10b981;
    border-color: #10b981 #e5e7eb #e5e7eb #10b981 !important;
}

.modeo-toast--success .modeo-toast__icon {
    color: #10b981;
}

.modeo-toast--success .modeo-toast__message {
    color: #166534 !important; /* green-800 */
}

.modeo-toast--error {
    background: #fef2f2 !important; /* red-50 */
    border-left: 4px solid #ef4444;
    border-color: #ef4444 #e5e7eb #e5e7eb #ef4444 !important;
}

.modeo-toast--error .modeo-toast__icon {
    color: #ef4444;
}

.modeo-toast--error .modeo-toast__message {
    color: #991b1b !important; /* red-800 */
}

.modeo-toast--info {
    background: #eff6ff !important; /* blue-50 */
    border-left: 4px solid #3b82f6;
    border-color: #3b82f6 #e5e7eb #e5e7eb #3b82f6 !important;
}

.modeo-toast--info .modeo-toast__icon {
    color: #3b82f6;
}

.modeo-toast--info .modeo-toast__message {
    color: #1e40af !important; /* blue-800 */
}

.modeo-toast--warning {
    background: #fffbeb !important; /* yellow-50 */
    border-left: 4px solid #f59e0b;
    border-color: #f59e0b #e5e7eb #e5e7eb #f59e0b !important;
}

.modeo-toast--warning .modeo-toast__icon {
    color: #f59e0b;
}

.modeo-toast--warning .modeo-toast__message {
    color: #92400e !important; /* yellow-800 */
}

/* Action Buttons by Type */
.modeo-toast--success .modeo-toast__action {
    color: #10b981;
}

.modeo-toast--error .modeo-toast__action {
    color: #ef4444;
}

.modeo-toast--info .modeo-toast__action {
    color: #3b82f6;
}

.modeo-toast--warning .modeo-toast__action {
    color: #f59e0b;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .modeo-toast {
        min-width: auto;
        padding: 0.875rem 1rem;
    }

    .modeo-toast__message {
        font-size: 0.875rem;
    }

    .modeo-toast__icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    .modeo-toast__actions {
        margin-top: 0.5rem;
    }

    .modeo-toast__action {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Animation for multiple toasts */
.modeo-toast-container .modeo-toast:not(:last-child) {
    margin-bottom: 0;
}

/* Ensure toast is always visible and above everything */
.modeo-toast-container {
    visibility: visible !important;
    opacity: 1 !important;
}

.modeo-toast--show {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Better contrast for text in toasts */
.modeo-toast__message strong,
.modeo-toast__message b {
    font-weight: 600;
}

.modeo-toast__message em,
.modeo-toast__message i {
    font-style: italic;
}

/* Ensure toast container doesn't interfere with page layout */
body:has(.modeo-toast-container) {
    overflow-x: hidden;
}

/* Hide WooCommerce default notices on checkout - we use toasts instead */
body.woocommerce-checkout .woocommerce-error,
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-checkout .woocommerce-info {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Show notices wrapper only if we want to keep structure */
.woocommerce-notices-wrapper:empty {
    display: none !important;
}

