/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    max-width: 350px;
}

/* Toast Base Styles */
.toast {
    position: relative;
    margin-bottom: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 350px;
}

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

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

/* Toast Types */
.toast-success {
    background: #10b981;
    color: white;
}

.toast-error {
    background: #ef4444;
    color: white;
}

.toast-warning {
    background: #f59e0b;
    color: white;
}

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

/* Toast Icon */
.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

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

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.toast-message {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    color: #ffffff !important; /* ensure readable on colored backgrounds */
    opacity: 1; /* full contrast */
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); /* stronger readability */
}

/* Ensure both title and message are bright on any themed bg */
.toast .toast-title,
.toast .toast-message {
    color: #ffffff !important;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 8px 8px;
    transition: width linear;
}

/* Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}
