/**
 * Caution Banner CSS
 * Custom styles for the security alert banner without Bootstrap dependencies
 */

/* Main banner container */
.caution-banner {
    position: fixed;
    display: none;
    top: 93px; /* Position below the SonicWall header */
    left: 0;
    width: 100%;
    z-index: 1050;
    margin: 0;
    padding: 16px 20px;
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    border-top: 1px solid #ffecb5;
    border-left: none;
    border-right: none;
    color: #664d03;
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

/* Banner content wrapper */
.caution-banner-content {
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Warning icon */
.caution-banner-icon {
    margin-right: 15px;
    font-size: 20px;
    color: #ffc107;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Main message content */
.caution-banner-message {
    flex: 1;
    margin-right: 10px;
    min-width: 0; /* Allow text to wrap */
    align-items: center;
    text-align: left;
}

/* Strong text styling */
.caution-banner-message strong {
    font-weight: 700;
    color: #664d03;
}

/* Link styling */
.caution-banner-message a {
    color: #664d03;
    text-decoration: underline;
    font-weight: 600;
}

.caution-banner-message a:hover {
    color: #332701;
    text-decoration: underline;
}

/* Close button */
.caution-banner-close {
    background: none;
    border: none;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: #664d03;
    cursor: pointer;
    padding: 4px;
    margin: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.caution-banner-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #332701;
}

.caution-banner-close:focus {
    outline: 2px solid #ff791a;
    outline-offset: 2px;
}

/* Close button X symbol */
.caution-banner-close::before {
    content: "×";
    font-size: 24px;
    line-height: 1;
}

/* Show state */
.caution-banner.show {
    transform: translateY(0);
}

/* Hide state */
.caution-banner.hide {
    transform: translateY(-100%);
}

/* Responsive design */
@media (max-width: 768px) {
    .caution-banner {
        padding: 16px;
        font-size: 13px;
        min-height: 65px;
    }

    .caution-banner-content {
        display: block;
        position: relative;
        padding-right: 40px; /* Space for close button */
    }

    .caution-banner-message {
        display: block;
        padding-left: 35px; /* Space for icon */
        margin-right: 0;
        text-align: left;
    }

    .caution-banner-icon {
        position: absolute;
        left: 0;
        top: 2px;
        margin-right: 0;
    }

    .caution-banner-close {
        position: absolute;
        top: 16px;
        right: 16px;
    }

    /* Adjust mobile spacing */
    body.has-caution-banner.banner-visible #mainContent {
        margin-top: 175px; /* topBanner + mobile banner height */
    }
}

/* Adjust main content margin to account for banner */
body.has-caution-banner #mainContent {
    margin-top: 93px; /* Existing topBanner height */
}

/* Additional spacing when banner is visible */
body.has-caution-banner.banner-visible #mainContent {
    margin-top: 170px; /* topBanner (93px) + banner height (~77px) */
}

/* Fade effect for smooth hiding */
.caution-banner.fade-out {
    opacity: 0;
    transition: opacity 0.15s ease-in-out, transform 0.3s ease-in-out;
}
