/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    transition: gap 0.3s ease;
    align-items: flex-end;
}

.toast-container.position-bottom-center,
.toast-container.position-bottom-left,
.toast-container.position-bottom-right {
    flex-direction: column-reverse;
}

.toast {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 500px;
    width: auto;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
    position: relative;
    border-left: 4px solid;
    transition: transform 0.3s ease, opacity 0.3s ease, margin 0.3s ease, height 0.3s ease, 
                padding 0.4s ease, min-width 0.4s ease, max-width 0.4s ease, font-size 0.4s ease;
    will-change: transform, height, margin;
    overflow: hidden;
}

.toast-container.position-bottom-center .toast,
.toast-container.position-top-center .toast {
    margin-left: auto;
    margin-right: auto;
}

.toast.fade-out {
    animation: fadeOutRight 0.3s ease forwards;
}

/* Bottom positioned toasts slide up from bottom */
.toast-container.position-bottom-center .toast,
.toast-container.position-bottom-left .toast,
.toast-container.position-bottom-right .toast {
    animation: slideInUp 0.3s ease;
}

.toast-container.position-bottom-center .toast.fade-out,
.toast-container.position-bottom-left .toast.fade-out,
.toast-container.position-bottom-right .toast.fade-out {
    animation: fadeOutDown 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Toast Types */
.toast.toast-success {
    border-left-color: #28a745;
    background-color: #e6f7e6;
}

.toast.toast-error {
    border-left-color: #f44336;
    background-color: #ffebee;
}

.toast.toast-warning {
    border-left-color: #ff9800;
    background-color: #fff3e0;
}

.toast.toast-info {
    border-left-color: #0066cc;
    background-color: #e6f2ff;
}

.toast.toast-default {
    border-left-color: #666666;
    background-color: #ffffff;
}

/* Toast Icon */
.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: font-size 0.4s ease, width 0.4s ease, height 0.4s ease;
}

.toast.toast-success .toast-icon {
    color: #28a745;
}

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

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

.toast.toast-info .toast-icon {
    color: #0066cc;
}

.toast.toast-default .toast-icon {
    color: #666666;
}

/* Toast Content */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
    transition: font-size 0.4s ease;
}

.toast-message {
    font-size: 0.875rem;
    color: #4d4d4d;
    margin: 0;
    line-height: 1.5;
    transition: font-size 0.4s ease;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #666666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease, font-size 0.4s ease, width 0.4s ease, height 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 4px;
}

.toast-close:hover {
    color: #003366;
    background-color: rgba(0, 0, 0, 0.05);
}

/* Toast Actions */
.toast-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.toast-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s ease, padding 0.4s ease, font-size 0.4s ease;
}

.toast-action-btn.primary {
    background-color: #0066cc;
    color: #ffffff;
}

.toast-action-btn.primary:hover {
    background-color: #0052a5;
}

.toast-action-btn.secondary {
    background-color: transparent;
    color: #0066cc;
    border: 1px solid #0066cc;
}

.toast-action-btn.secondary:hover {
    background-color: #e6f2ff;
}

/* Toast Positions */
.toast-container.position-top-left {
    top: 1rem;
    left: 1rem;
    right: auto;
}

.toast-container.position-top-center {
    top: 1rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.toast-container.position-top-right {
    top: 1rem;
    right: 1rem;
    left: auto;
}

.toast-container.position-bottom-left {
    top: auto;
    bottom: 1rem;
    left: 1rem;
    right: auto;
}

.toast-container.position-bottom-center {
    top: auto;
    bottom: 1rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    align-items: center;
    width: auto;
}

.toast-container.position-bottom-right {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: auto;
}

/* Tablet Mode Styles */
body.tablet-mode .toast-container {
    top: 1.5rem;
    right: 1.5rem;
    gap: 1rem;
}

body.tablet-mode .toast {
    min-width: 400px;
    max-width: 700px;
    padding: 1.5rem 2rem;
    font-size: 1.75rem;
}

body.tablet-mode .toast-icon {
    font-size: 2rem;
    width: 32px;
    height: 32px;
}

body.tablet-mode .toast-title {
    font-size: 2rem;
}

body.tablet-mode .toast-message {
    font-size: 1.75rem;
}

body.tablet-mode .toast-close {
    font-size: 2rem;
    width: 32px;
    height: 32px;
}

body.tablet-mode .toast-action-btn {
    font-size: 1.75rem;
    padding: 1rem 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

