/* =============================================================================
 * PharmAssist Toast Notification Styles
 * Location: styles/toast.css
 *
 * Integrates with the existing dark/light theme via CSS custom properties.
 * ============================================================================= */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* Position variants */
.toast-container.top-right  { top: 20px; right: 20px; bottom: auto; left: auto; }
.toast-container.top-left   { top: 20px; left: 20px; right: auto; bottom: auto; }
.toast-container.bottom-right { top: auto; bottom: 20px; right: 20px; left: auto; }
.toast-container.bottom-left  { top: auto; bottom: 20px; left: 20px; right: auto; }
.toast-container.top-center {
    top: 20px;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
}
.toast-container.bottom-center {
    top: auto;
    bottom: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    background: var(--bg-card, #141414);
    border: 1px solid var(--border-color, #2a2a2a);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(110%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 260px;
}

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

.toast-hiding {
    opacity: 0;
    transform: translateX(110%);
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    line-height: 1;
}

/* Toast Message */
.toast-message {
    flex: 1;
    color: var(--text-primary, #ffffff);
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

/* Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary, #a0a0a0);
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.toast-close:hover,
.toast-close:focus {
    color: var(--text-primary, #ffffff);
    outline: none;
}

/* Type Variants */
.toast-success {
    border-left: 4px solid var(--success, #10b981);
}
.toast-success .toast-icon {
    background: var(--success, #10b981);
}

.toast-error {
    border-left: 4px solid var(--error, #ef4444);
}
.toast-error .toast-icon {
    background: var(--error, #ef4444);
}

.toast-warning {
    border-left: 4px solid var(--warning, #f59e0b);
}
.toast-warning .toast-icon {
    background: var(--warning, #f59e0b);
}

.toast-info {
    border-left: 4px solid var(--info, #3b82f6);
}
.toast-info .toast-icon {
    background: var(--info, #3b82f6);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .toast-container,
    .toast-container.top-right,
    .toast-container.top-left,
    .toast-container.bottom-right,
    .toast-container.bottom-left,
    .toast-container.top-center,
    .toast-container.bottom-center {
        top: auto;
        bottom: 16px;
        left: 12px;
        right: 12px;
        max-width: none;
        transform: none;
    }

    .toast {
        transform: translateY(120%);
        min-width: 0;
    }

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

    .toast-hiding {
        transform: translateY(120%);
    }
}

/* Light mode support */
body.light-mode .toast {
    background: var(--bg-card, #ffffff);
    border-color: var(--border-color, #e5e7eb);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-mode .toast-message {
    color: var(--text-primary, #1e293b);
}

body.light-mode .toast-close {
    color: var(--text-secondary, #64748b);
}

body.light-mode .toast-close:hover,
body.light-mode .toast-close:focus {
    color: var(--text-primary, #1e293b);
}
