/**
 * Enhanced Notification System CSS
 * Ensures proper styling for viewport-aware notifications
 * 
 * @version     2.0.0
 * @package     sellacious
 * @copyright   Copyright (C) 2012-2020 Bhartiy Web Technologies. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

#enhanced-message-container {
    position: fixed !important;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    max-width: 600px;
    width: 90%;
    pointer-events: none;
}

.enhanced-alert {
    position: relative;
    margin-bottom: 10px;
    display: block;
    pointer-events: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 6px;
    max-width: 100%;
    word-wrap: break-word;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.enhanced-alert .alert-icon {
    margin-right: 8px;
    font-size: 16px;
}

.enhanced-alert .close {
    position: absolute;
    right: 10px;
    top: 8px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    opacity: 0.6;
    cursor: pointer;
    color: inherit;
    font-weight: bold;
    padding: 0;
    margin: 0;
    z-index: 1;
}

.enhanced-alert .close:hover {
    opacity: 1;
}

.enhanced-alert .alert-message {
    padding-right: 25px;
}

.enhanced-alert .auto-hide-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: rgba(255,255,255,0.4);
    width: 100%;
    transition: width linear;
    border-radius: 0 0 6px 6px;
}

/* Alert type specific styles */
.enhanced-alert.alert-success {
    background-color: #dff0d8;
    border-color: #d6e9c6;
    color: #3c763d;
}

.enhanced-alert.alert-success .auto-hide-progress {
    background-color: rgba(60, 118, 61, 0.3);
}

.enhanced-alert.alert-danger {
    background-color: #f2dede;
    border-color: #ebccd1;
    color: #a94442;
}

.enhanced-alert.alert-danger .auto-hide-progress {
    background-color: rgba(169, 68, 66, 0.3);
}

.enhanced-alert.alert-warning {
    background-color: #fcf8e3;
    border-color: #faebcc;
    color: #8a6d3b;
}

.enhanced-alert.alert-warning .auto-hide-progress {
    background-color: rgba(138, 109, 59, 0.3);
}

.enhanced-alert.alert-info {
    background-color: #d9edf7;
    border-color: #bce8f1;
    color: #31708f;
}

.enhanced-alert.alert-info .auto-hide-progress {
    background-color: rgba(49, 112, 143, 0.3);
}

/* Animation for smooth entry/exit */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.enhanced-alert.animate-in {
    animation: slideInDown 0.3s ease;
}

.enhanced-alert.animate-out {
    animation: slideOutUp 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #enhanced-message-container {
        width: 95%;
        max-width: none;
        top: 60px;
    }
    
    .enhanced-alert {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .enhanced-alert .alert-icon {
        font-size: 14px;
        margin-right: 6px;
    }
    
    .enhanced-alert .close {
        font-size: 18px;
        right: 8px;
        top: 6px;
    }
}

@media (max-width: 480px) {
    #enhanced-message-container {
        top: 50px;
    }
    
    .enhanced-alert {
        border-radius: 4px;
        margin-bottom: 6px;
    }
}

/* Ensure compatibility with existing Bootstrap alert styles */
.enhanced-alert.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .enhanced-alert {
        box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }
    
    .enhanced-alert.alert-success {
        background-color: rgba(92, 184, 92, 0.2);
        border-color: rgba(92, 184, 92, 0.4);
        color: #5cb85c;
    }
    
    .enhanced-alert.alert-danger {
        background-color: rgba(217, 83, 79, 0.2);
        border-color: rgba(217, 83, 79, 0.4);
        color: #d9534f;
    }
    
    .enhanced-alert.alert-warning {
        background-color: rgba(240, 173, 78, 0.2);
        border-color: rgba(240, 173, 78, 0.4);
        color: #f0ad4e;
    }
    
    .enhanced-alert.alert-info {
        background-color: rgba(91, 192, 222, 0.2);
        border-color: rgba(91, 192, 222, 0.4);
        color: #5bc0de;
    }
}
