﻿/* Toast Notifications CSS */

.toast-notifications-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    max-width: 400px;
    width: 100%;
}

/* Position classes */
.toast-position-top-right {
    top: 20px;
    right: 20px;
}

.toast-position-top-left {
    top: 20px;
    left: 20px;
}

.toast-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.toast-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.toast-position-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.toast-position-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Toast notification base styles */
.toast-notification {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 16px;
    min-width: 320px;
    max-width: 400px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
    border-left: 4px solid #ccc;
    position: relative;
    overflow: hidden;
}

/* Bigger size for notifications without headers */
.toast-notification.toast-no-header {
    min-width: 380px;
    max-width: 480px;
    min-height: 80px;
}

/* Show state */
.toast-notification.toast-show {
    opacity: 1;
    transform: translateX(0);
}

/* Hide state */
.toast-notification.toast-hiding {
    opacity: 0;
    transform: translateX(100%);
    margin-bottom: 0;
    max-height: 0;
    padding: 0;
}

/* Toast type specific styles */
.toast-notification.toast-success {
    border-left-color: #28a745;
}

.toast-notification.toast-error {
    border-left-color: #dc3545;
}

.toast-notification.toast-warning {
    border-left-color: #ffc107;
}

.toast-notification.toast-info {
    border-left-color: #17a2b8;
}

/* Toast content */
.toast-content {
    padding: 0;
    min-height:80px;
}

/* Toast header */
.toast-header {
    display: flex;
    align-items: center;
    padding: 12px 16px 8px 16px;
    border-radius: 8px 8px 0 0;
}

.toast-header-text {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
    margin-left: 8px;
}

.toast-success .toast-header-text {
  color: #1a5f1a;
}

.toast-info .toast-header-text {
  color: #0d6efd;
}

.toast-warning .toast-header-text {
  color: #b18401;
}

.toast-error .toast-header-text {
  color: #c50012;
}


/* Toast body */
.toast-body {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    min-height: 80px;
}

/* Special layout for toasts with icons */
.toast-body:has(.toast-icon) {
    flex-direction: row;
    text-align: left;
}



.toast-message {
    flex: 1;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

/* Larger font size for messages without headers */
.toast-notification.toast-no-header .toast-message {
    font-size: 16px;
    line-height: 1.5;
}

/* Error notification text styling */
.toast-notification.toast-error .toast-message {
    font-size: 15px;
    font-weight: 600;
    color: #721c24;
}

/* Error notification text styling for no-header toasts */
.toast-notification.toast-error.toast-no-header .toast-message {
    font-size: 17px;
    font-weight: 700;
    color: #721c24;
}

/* Toast icons */
.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

/* Larger icons for toasts without headers */
.toast-notification.toast-no-header .toast-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.toast-icon-success {
    background-color: #28a745;
}

.toast-icon-error {
    background-color: #dc3545;
}

.toast-icon-warning {
    background-color: #ffc107;
    color: #333;
}

.toast-icon-info {
    background-color: #17a2b8;
}

/* Toast images */
.toast-image {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

  .toast-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 5px;
  }

/* Close button */
.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.toast-close:hover {
    background-color: #f0f0f0;
    color: #666;
}

.toast-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Action link */
.toast-action-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    margin-top: 8px;
    display: inline-block;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
    width: 100%;
}

.toast-action-link:hover {
    border-bottom-color: #007bff;
}

/* Enhanced Progress Bar Styles */
.toast-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-radius: 0 0 8px 8px;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    border-radius: 0 0 8px 8px;
    transition: width linear;
}

.toast-progress-bar-success {
    background: #28a745;
}

.toast-progress-bar-error {
    background: #dc3545;
}

.toast-progress-bar-warning {
    background: #ffc107;
}

.toast-progress-bar-info {
    background: #17a2b8;
}

/* Legacy progress bar for backward compatibility */
.toast-notification.toast-progress::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    animation: toast-progress linear;
    border-radius: 0 0 8px 8px;
}

.toast-notification.toast-success.toast-progress::after {
    background: #28a745;
}

.toast-notification.toast-error.toast-progress::after {
    background: #dc3545;
}

.toast-notification.toast-warning.toast-progress::after {
    background: #ffc107;
}

.toast-notification.toast-info.toast-progress::after {
    background: #17a2b8;
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Progress bar hover effects */
.toast-notification:hover .toast-progress-bar {
    opacity: 0.8;
}

.toast-notification:hover .toast-progress-container {
    background: rgba(0, 0, 0, 0.15);
}

/* Progress bar accessibility */
.toast-progress-bar[aria-valuenow="0"] {
    width: 0%;
}

.toast-progress-bar[aria-valuenow="100"] {
    width: 100%;
}

/* Left positioned toast animations */
.toast-position-top-left .toast-notification,
.toast-position-bottom-left .toast-notification {
    transform: translateX(-100%);
}

.toast-position-top-left .toast-notification.toast-show,
.toast-position-bottom-left .toast-notification.toast-show {
    transform: translateX(0);
}

.toast-position-top-left .toast-notification.toast-hiding,
.toast-position-bottom-left .toast-notification.toast-hiding {
    transform: translateX(-100%);
}

/* Center positioned toast animations */
.toast-position-top-center .toast-notification,
.toast-position-bottom-center .toast-notification {
    transform: translateY(-100%) translateX(-50%);
}

.toast-position-top-center .toast-notification.toast-show,
.toast-position-bottom-center .toast-notification.toast-show {
    transform: translateY(0) translateX(-50%);
}

.toast-position-top-center .toast-notification.toast-hiding,
.toast-position-bottom-center .toast-notification.toast-hiding {
    transform: translateY(-100%) translateX(-50%);
}

/* Responsive design */
@media (max-width: 480px) {
    .toast-notifications-container {
        left: 10px !important;
        right: 10px !important;
        max-width: none;
        transform: none !important;
    }
    
    .toast-notification {
        min-width: auto;
        max-width: none;
        margin: 0 0 10px 0;
    }
    
    /* Reset no-header sizing for mobile */
    .toast-notification.toast-no-header {
        min-width: auto;
        max-width: none;
    }
    
    .toast-header {
        padding: 10px 12px 6px 12px;
    }
    
    .toast-body {
        padding: 8px 12px 12px 12px;
    }
    
    /* Adjust no-header padding for mobile */
    .toast-notification.toast-no-header .toast-body {
        padding: 12px 14px;
    }
    
    .toast-header-text {
        font-size: 15px;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    /* Adjust no-header message size for mobile */
    .toast-notification.toast-no-header .toast-message {
        font-size: 15px;
    }
    
    /* Error notification text for mobile */
    .toast-notification.toast-error .toast-message {
        font-size: 14px;
    }
    
    .toast-notification.toast-error.toast-no-header .toast-message {
        font-size: 15px;
    }
}


/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .toast-notification {
        transition: opacity 0.2s ease;
        transform: none !important;
    }
    
    .toast-notification.toast-show {
        transform: none !important;
    }
    
    .toast-notification.toast-hiding {
        transform: none !important;
    }
    
    .toast-progress-bar {
        transition: none;
    }
    
    @keyframes toast-progress {
        from {
            width: 100%;
        }
        to {
            width: 0%;
        }
    }
}}