/*
 * Enhanced Toastr CSS for Sales Theme
 * Compatible with toastr v2.1.3
 */

:root {
    --toast-primary: #4a6cf7;
    --toast-success: #10b981;
    --toast-error: #ef4444;
    --toast-warning: #f59e0b;
    --toast-info: #3b82f6;
    --toast-dark: #1f2937;
    --toast-light: #f9fafb;
    --toast-border-radius: 8px;
    --toast-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --toast-animation-duration: 0.3s;
}

/* Base Toast Container */
#toast-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#toast-container * {
    box-sizing: border-box;
}

/* Individual Toast Styling */
#toast-container > div {
    position: relative;
    pointer-events: auto;
    overflow: hidden;
    margin: 0 0 12px;
    padding: 16px 20px 16px 60px;
    width: 380px;
    border-radius: var(--toast-border-radius);
    background-position: 20px center;
    background-repeat: no-repeat;
    background-size: 24px 24px;
    box-shadow: var(--toast-shadow);
    color: #fff;
    opacity: 0.95;
    transition: all var(--toast-animation-duration) cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#toast-container > div:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    cursor: pointer;
}

/* Toast Types with Modern Icons */
#toast-container > .toast-info {
    background-color: var(--toast-info);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

#toast-container > .toast-error {
    background-color: var(--toast-error);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z'/%3E%3C/svg%3E");
}

#toast-container > .toast-success {
    background-color: var(--toast-success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

#toast-container > .toast-warning {
    background-color: var(--toast-warning);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

/* Title and Message Styling */
.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.toast-message {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    opacity: 0.9;
}

.toast-message a,
.toast-message label {
    color: #fff;
    text-decoration: underline;
    font-weight: 500;
}

.toast-message a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

/* Close Button */
.toast-close-button {
    position: absolute;
    right: 12px;
    top: 12px;
    float: right;
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.8;
    line-height: 1;
    background: rgba(255, 255, 255, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: rotate(90deg);
}

.rtl .toast-close-button {
    left: 12px;
    right: auto;
}

button.toast-close-button {
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    -webkit-appearance: none;
    outline: none;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.3);
    width: 100%;
    transform-origin: left;
    animation: toast-progress linear forwards;
}

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

/* Position Variations */
.toast-top-center {
    top: 20px;
    right: 0;
    width: 100%;
}

.toast-bottom-center {
    bottom: 20px;
    right: 0;
    width: 100%;
}

.toast-top-full-width {
    top: 20px;
    right: 0;
    width: 100%;
}

.toast-bottom-full-width {
    bottom: 20px;
    right: 0;
    width: 100%;
}

.toast-top-left {
    top: 20px;
    left: 20px;
}

.toast-top-right {
    top: 20px;
    right: 20px;
}

.toast-bottom-right {
    right: 20px;
    bottom: 20px;
}

.toast-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Center aligned toasts */
#toast-container.toast-bottom-center > div,
#toast-container.toast-top-center > div {
    width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* Full width toasts */
#toast-container.toast-bottom-full-width > div,
#toast-container.toast-top-full-width > div {
    width: 96%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* RTL Support */
#toast-container > div.rtl {
    direction: rtl;
    padding: 16px 60px 16px 20px;
    background-position: calc(100% - 20px) center;
}

/* Animation Classes */
.toast-enter {
    animation: toastSlideIn 0.3s ease-out;
}

.toast-leave {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 0.95;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 0.95;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Custom Theme Variations */
#toast-container > .toast-primary {
    background-color: var(--toast-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

#toast-container > .toast-dark {
    background-color: var(--toast-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z'/%3E%3C/svg%3E");
}

/* Responsive Design */
@media all and (max-width: 480px) {
    #toast-container > div {
        width: 90%;
        max-width: 320px;
        padding: 14px 16px 14px 50px;
        margin: 0 auto 10px;
        background-position: 16px center;
        background-size: 20px 20px;
    }
    
    #toast-container > div.rtl {
        padding: 14px 50px 14px 16px;
    }
    
    #toast-container.toast-bottom-center > div,
    #toast-container.toast-top-center > div {
        width: 90%;
    }
    
    .toast-title {
        font-size: 14px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    .toast-close-button {
        width: 22px;
        height: 22px;
        font-size: 16px;
    }
    
    .toast-top-left,
    .toast-top-right,
    .toast-bottom-left,
    .toast-bottom-right {
        left: 10px;
        right: 10px;
    }
}

@media all and (min-width: 481px) and (max-width: 768px) {
    #toast-container > div {
        width: 340px;
    }
    
    #toast-container.toast-bottom-center > div,
    #toast-container.toast-top-center > div {
        width: 340px;
    }
}

/* Print Styles */
@media print {
    #toast-container {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    #toast-container > div {
        border: 2px solid #fff;
    }
    
    .toast-close-button {
        border: 1px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #toast-container > div,
    .toast-close-button,
    .toast-progress {
        transition: none;
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #toast-container > .toast-dark {
        background-color: #111827;
    }
    
    #toast-container > .toast-light {
        background-color: #374151;
        color: #f9fafb;
    }
}

/* Sales Theme Specific - Matching your sales process colors */
#toast-container > .toast-sales-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-left: 4px solid #047857;
}

#toast-container > .toast-sales-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-left: 4px solid #b91c1c;
}

#toast-container > .toast-sales-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-left: 4px solid #b45309;
}

#toast-container > .toast-sales-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-left: 4px solid #1d4ed8;
}