/**
 * Toast Notification Styles
 */

/* Container positions */
.toast-container {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    max-width: 100%;
}

.toast-container.toast-top-right {
    top: 0;
    right: 0;
    align-items: flex-end;
}

.toast-container.toast-top-left {
    top: 0;
    left: 0;
    align-items: flex-start;
}

.toast-container.toast-bottom-right {
    bottom: 0;
    right: 0;
    align-items: flex-end;
}

.toast-container.toast-bottom-left {
    bottom: 0;
    left: 0;
    align-items: flex-start;
}

.toast-container.toast-top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.toast-container.toast-bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

/* Toast base styles */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
    pointer-events: all;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-top-left .toast,
.toast-bottom-left .toast {
    transform: translateX(-100%);
}

.toast-top-center .toast,
.toast-bottom-center .toast {
    transform: translateY(-100%);
}

.toast-bottom-center .toast,
.toast-bottom-left .toast,
.toast-bottom-right .toast {
    transform: translateY(100%);
}

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

.toast.toast-hide {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
}

.toast-top-left .toast.toast-hide,
.toast-bottom-left .toast.toast-hide {
    transform: translateX(-100%) scale(0.9);
}

/* Toast icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

/* Toast content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.toast-message {
    font-size: 14px;
    color: #555;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Close button */
.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    border-radius: 0 0 12px 12px;
}

/* Toast types */

/* Success */
.toast-success {
    border-left: 4px solid #10b981;
}

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

.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* Error */
.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Warning */
.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Info */
.toast-info {
    border-left: 4px solid #3b82f6;
}

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

.toast-info .toast-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Cart - Your primary color */
.toast-cart {
    border-left: 4px solid #336699;
    background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
}

.toast-cart .toast-icon {
    color: #336699;
}

.toast-cart .toast-progress-bar {
    background: linear-gradient(90deg, #336699, #5588bb);
}

/* Wishlist */
.toast-wishlist {
    border-left: 4px solid #ec4899;
    background: linear-gradient(135deg, #fff 0%, #fdf2f8 100%);
}

.toast-wishlist .toast-icon {
    color: #ec4899;
}

.toast-wishlist .toast-progress-bar {
    background: linear-gradient(90deg, #ec4899, #f472b6);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }

    .toast-title {
        color: #f3f4f6;
    }

    .toast-message {
        color: #d1d5db;
    }

    .toast-close {
        color: #9ca3af;
    }

    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #f3f4f6;
    }

    .toast-cart {
        background: linear-gradient(135deg, #1f2937 0%, #1e3a5f 100%);
    }

    .toast-wishlist {
        background: linear-gradient(135deg, #1f2937 0%, #4a1d3d 100%);
    }
}

/* RTL Support */
[dir="rtl"] .toast {
    border-left: none;
    border-right: 4px solid;
}

[dir="rtl"] .toast-success {
    border-right-color: #10b981;
}

[dir="rtl"] .toast-error {
    border-right-color: #ef4444;
}

[dir="rtl"] .toast-warning {
    border-right-color: #f59e0b;
}

[dir="rtl"] .toast-info {
    border-right-color: #3b82f6;
}

[dir="rtl"] .toast-cart {
    border-right-color: #336699;
}

[dir="rtl"] .toast-wishlist {
    border-right-color: #ec4899;
}

[dir="rtl"] .toast-close {
    right: auto;
    left: 8px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toast-container {
        padding: 10px;
    }

    .toast {
        min-width: 280px;
        max-width: calc(100vw - 20px);
        padding: 12px 16px;
    }

    .toast-title {
        font-size: 14px;
    }

    .toast-message {
        font-size: 13px;
    }
}

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

/* Hover effect */
.toast:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ============================================
   CONFIRMATION MODAL STYLES
   ============================================ */

.toast-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.toast-modal-backdrop.toast-modal-show {
    opacity: 1;
    visibility: visible;
}

.toast-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-modal-show .toast-modal {
    transform: scale(1) translateY(0);
}

.toast-modal-icon {
    margin-bottom: 16px;
}

.toast-modal-icon svg {
    width: 56px;
    height: 56px;
}

.toast-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.toast-modal-message {
    font-size: 15px;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.toast-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.toast-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-width: 120px;
}

.toast-btn:hover {
    transform: translateY(-2px);
}

.toast-btn:active {
    transform: translateY(0);
}

.toast-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.toast-btn-cancel:hover {
    background: #e5e7eb;
}

.toast-btn-primary {
    background: #336699;
    color: #fff;
}

.toast-btn-primary:hover {
    background: #2a5580;
    box-shadow: 0 4px 12px rgba(51, 102, 153, 0.4);
}

.toast-btn-danger {
    background: #ef4444;
    color: #fff;
}

.toast-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Dark mode for modal */
@media (prefers-color-scheme: dark) {
    .toast-modal {
        background: #1f2937;
    }

    .toast-modal-title {
        color: #f3f4f6;
    }

    .toast-modal-message {
        color: #9ca3af;
    }

    .toast-btn-cancel {
        background: #374151;
        color: #f3f4f6;
    }

    .toast-btn-cancel:hover {
        background: #4b5563;
    }
}

/* RTL support for modal */
[dir="rtl"] .toast-modal-actions {
    flex-direction: row-reverse;
}
