/* css/toast.css - Universal Toast Notification Styles */

/* Toast Container */
.toast-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    max-width: 300px;
    width: 100%;
}

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

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

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

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

/* Toast Base Styles */
.toast {
    pointer-events: auto;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: none;
    border-left: 4px solid;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    transform: translateX(100%);
    opacity: 0;
    font-family: var(--font-primary);
    max-width: 100%;
    position: relative;
}

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

.toast.toast-hide {
    transform: translateX(100%);
    opacity: 0;
    margin-bottom: 0;
    max-height: 0;
    padding: 0;
}

.toast:hover {
    transform: translateX(-2px);
    box-shadow: 0 8px 24px rgba(4, 40, 71, 0.25);
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    min-height: auto;
    position: relative;
}

.toast-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.toast-text {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: var(--font-size-md);
    margin-bottom: 4px;
    line-height: 1.4;
}

.toast-message {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

/* Toast Type Styles - Matching Working Examples */

/* Success Toast - Light green background with green left border */
.toast-success {
    background-color: #f1f8f4;
    color: #231f20;
    border-left-color: #4caf50;
}

.toast-success .toast-title {
    color: #231f20;
}

.toast-success .toast-icon {
    color: #4caf50;
}

.toast-success .toast-close {
    color: #4caf50;
}

/* Error Toast - Light red background with red left border */
.toast-error {
    background-color: #fef1f0;
    color: #231f20;
    border-left-color: #f44336;
}

.toast-error .toast-title {
    color: #231f20;
}

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

.toast-error .toast-close {
    color: #f44336;
}

/* Warning Toast - Light orange background with orange left border */
.toast-warning {
    background-color: #fff8e1;
    color: #231f20;
    border-left-color: #ff9800;
}

.toast-warning .toast-title {
    color: #231f20;
}

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

.toast-warning .toast-close {
    color: #ff9800;
}

/* Info Toast - Light blue background with blue left border */
.toast-info {
    background-color: #f0f4ff;
    color: #231f20;
    border-left-color: #2196f3;
}

.toast-info .toast-title {
    color: #231f20;
}

.toast-info .toast-icon {
    color: #2196f3;
}

.toast-info .toast-close {
    color: #2196f3;
}

/* Loading Toast - Light blue background with blue left border */
.toast-loading {
    background-color: #f0f4ff;
    color: #231f20;
    border-left-color: #2196f3;
}

.toast-loading .toast-title {
    color: #231f20;
}

.toast-loading .toast-icon {
    color: #2196f3;
    animation: spin 1s linear infinite;
}

.toast-loading .toast-close {
    color: #2196f3;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .toast-container.toast-top-right,
    .toast-container.toast-top-left {
        top: 16px;
    }

    .toast-container.toast-bottom-right,
    .toast-container.toast-bottom-left {
        bottom: 16px;
    }

    .toast-content {
        padding: 12px;
        min-height: 48px;
    }

    .toast-icon {
        font-size: 18px;
        margin-right: 10px;
    }

    .toast-message {
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .toast {
        margin-bottom: 8px;
    }

    .toast-content {
        padding: 10px;
    }

    .toast-close {
        top: 6px;
        right: 6px;
        font-size: 16px;
        width: 20px;
        height: 20px;
    }
}

/* Custom animations for different entrance directions */
.toast-container.toast-top-left .toast,
.toast-container.toast-bottom-left .toast {
    transform: translateX(-100%);
}

.toast-container.toast-top-left .toast.toast-show,
.toast-container.toast-bottom-left .toast.toast-show {
    transform: translateX(0);
}

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

.toast-container.toast-top-left .toast:hover,
.toast-container.toast-bottom-left .toast:hover {
    transform: translateX(2px);
}