/**
 * Modern Professional Toast Notification Styles
 * Tesla Store - Toast Notification CSS
 */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

@media (max-width: 576px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateX(400px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: all;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast.hide {
    opacity: 0;
    transform: translateX(400px) scale(0.95);
}

/* Toast Types */
.toast-success {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    padding: 6px;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2.5;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    color: #1f2937;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.toast-message {
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Toast Close Button */
.toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #6b7280;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1f2937;
    transform: scale(1.1);
}

.toast-close:active {
    transform: scale(0.95);
}

/* Toast Action Button */
.toast-action {
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.toast-action:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.toast-action:active {
    transform: translateY(0);
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    transform-origin: left;
    animation: toast-progress linear forwards;
}

.toast-success .toast-progress {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.toast-warning .toast-progress {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.toast-info .toast-progress {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .toast-success {
        background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(6, 78, 59, 0.3) 100%);
    }

    .toast-error {
        background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(127, 29, 29, 0.3) 100%);
    }

    .toast-warning {
        background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(120, 53, 15, 0.3) 100%);
    }

    .toast-info {
        background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(30, 58, 138, 0.3) 100%);
    }

    .toast-title {
        color: #f9fafb;
    }

    .toast-message {
        color: #d1d5db;
    }

    .toast-close {
        background: rgba(255, 255, 255, 0.1);
        color: #9ca3af;
    }

    .toast-close:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #f9fafb;
    }

    .toast-action {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: #f9fafb;
    }

    .toast-action:hover {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* Animation for mobile */
@media (max-width: 576px) {
    .toast {
        transform: translateY(-100px) scale(0.95);
    }

    .toast.show {
        transform: translateY(0) scale(1);
    }

    .toast.hide {
        transform: translateY(-100px) scale(0.95);
    }
}

/* RTL Support */
[dir="rtl"] .toast-container {
    right: auto;
    left: 20px;
}

[dir="rtl"] .toast {
    transform: translateX(-400px) scale(0.95);
}

[dir="rtl"] .toast.show {
    transform: translateX(0) scale(1);
}

[dir="rtl"] .toast.hide {
    transform: translateX(-400px) scale(0.95);
}

[dir="rtl"] .toast-close {
    right: auto;
    left: 12px;
}

[dir="rtl"] .toast {
    border-left: none;
    border-right: 4px solid;
}

/* Confirmation and Prompt Modal Styles */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

.toast-confirm-overlay,
.toast-prompt-overlay {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.toast-confirm-modal button:hover,
.toast-prompt-modal button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-confirm-modal button:active,
.toast-prompt-modal button:active {
    transform: translateY(0);
}

.toast-prompt-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

