/**
 * VMP Site Alert System CSS - UPDATED for Flash Fix and Animation
 * Styles the alert bar, ensures mobile optimization, and manages sticky positioning.
 */

/* 1. Base Container and Positioning */
#vmp-site-alert {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 99999;
    padding: 10px 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    
    /* ADDED: Smooth transition for fade-out */
    transition: opacity 0.3s ease-in-out, height 0.3s ease-in-out, padding 0.3s ease-in-out; 
}

/* 6. Pre-Hiding for Dismissal Logic (Fixes the "Flash") */
/* Start the alert hidden. JS will remove this class if the alert is NOT dismissed. */
#vmp-site-alert.vmp-check-dismissal {
    display: none !important; /* Use !important to override display:flex */
    opacity: 0;
    height: 0;
    padding: 0;
}

/* 2. Layout for Dismissible Alert (Mobile-Optimized) */
.vmp-alert-bar.vmp-alert-dismissible {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vmp-alert-content {
    flex-grow: 1;
    text-align: left;
    margin-right: 15px;
}

/* 3. Alert Type Styling (Coloring) */
.vmp-alert-information {
    background-color: #d1ecf1;
    color: #0c5460;
}
.vmp-alert-warning {
    background-color: #fff3cd;
    color: #856404;
}
.vmp-alert-urgent {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: bold;
}

/* 4. Dismiss Button Styling */
.vmp-dismiss-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.7;
    cursor: pointer;
    padding: 0 5px;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.vmp-dismiss-btn:hover,
.vmp-dismiss-btn:focus {
    opacity: 1;
    outline: none;
}

/* 5. State Management */

/* Hides the alert when the JavaScript adds this class */
#vmp-site-alert.is-dismissed {
    opacity: 0 !important; /* Start the fade out */
    height: 0 !important; /* Collapse the height */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 0;
    pointer-events: none;
    overflow: hidden; /* Ensure content is hidden during collapse */
    /* Add display: none after transition is done (optional, requires JS to listen for transition end) */
}