﻿/**
 * Cuba Admin Template Toast Styles
 * Native Bootstrap 5 toast styling following Cuba template specifications
 */

/* Toast container positioning and z-index */
.toast-container.cuba-toasts {
    z-index: 1055 !important;
}

/* Toast index and RTL support */
.toast-index {
    z-index: 1055;
}

.toast-rtl {
    direction: ltr; /* Keep toasts LTR even in RTL layouts */
}

/* Common spacing for toast content */
.common-space {
    padding: 15px;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Alert light variants for toasts */
.alert-light-success {
    background-color: rgba(81, 187, 37, 0.1);
    border: 1px solid rgba(81, 187, 37, 0.2);
    color: #51bb25;
}

.alert-light-warning {
    background-color: rgba(255, 184, 41, 0.1);
    border: 1px solid rgba(255, 184, 41, 0.2);
    color: #ffb829;
}

.alert-light-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.alert-light-info {
    background-color: rgba(21, 141, 247, 0.1);
    border: 1px solid rgba(21, 141, 247, 0.2);
    color: #158df7;
}

/* Stroke colors for Feather icons */
.stroke-success {
    stroke: #51bb25 !important;
    color: #51bb25 !important;
}

.stroke-warning {
    stroke: #ffb829 !important;
    color: #ffb829 !important;
}

.stroke-danger {
    stroke: #dc3545 !important;
    color: #dc3545 !important;
}

.stroke-info {
    stroke: #158df7 !important;
    color: #158df7 !important;
}

/* Toast body styling */
.toast .toast-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* Close search icon styling */
.close-search {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Toast close button styling */
.toast .btn-close {
    position: relative;
    margin: 0;
    padding: 0;
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

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

/* Toast animation */
.toast {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    animation: slideInRight 0.3s ease-out;
}

.toast.hide {
    animation: slideOutRight 0.3s ease-in;
}

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

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

/* Responsive adjustments */
@media (max-width: 576px) {
    .toast-container.cuba-toasts {
        left: 10px !important;
        right: 10px !important;
        top: 10px !important;
        width: auto !important;
        max-width: none !important;
    }
    
    .toast {
        margin-bottom: 8px;
    }
    
    .common-space {
        padding: 12px;
    }
    
    .toast .toast-body {
        font-size: 13px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .alert-light-success {
        background-color: rgba(81, 187, 37, 0.15);
        border-color: rgba(81, 187, 37, 0.3);
    }
    
    .alert-light-warning {
        background-color: rgba(255, 184, 41, 0.15);
        border-color: rgba(255, 184, 41, 0.3);
    }
    
    .alert-light-danger {
        background-color: rgba(220, 53, 69, 0.15);
        border-color: rgba(220, 53, 69, 0.3);
    }
    
    .alert-light-info {
        background-color: rgba(21, 141, 247, 0.15);
        border-color: rgba(21, 141, 247, 0.3);
    }
    
    .toast {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .alert-light-success {
        border-width: 2px;
    }
    
    .alert-light-warning {
        border-width: 2px;
    }
    
    .alert-light-danger {
        border-width: 2px;
    }
    
    .alert-light-info {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
    
    .toast.hide {
        animation: none;
    }
    
    .toast .btn-close {
        transition: none;
    }
}
