/**
 * 시스템 공지/점검 배너 스타일
 * @author 개발자 김용길
 * @since 2025.01
 * @modified 2025.12.04 - Footer 역할로 변경, 사이드바 고려
 */

/* ====================================
   Footer 역할을 하는 배너 래퍼
   ==================================== */
.system-banner-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width, 260px);
    right: 0;
    z-index: 1001;
    background: transparent;
    transition: left 0.3s ease;
}

/* 사이드바 축소 시 */
.sidebar-collapsed .system-banner-footer {
    left: var(--sidebar-collapsed-width, 78px);
}

/* 배너가 없을 때 footer 숨김 */
.system-banner-footer:empty {
    display: none;
}

/* ====================================
   개별 배너 스타일
   ==================================== */
.system-banner {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    animation: bannerSlideUp 0.3s ease;
}

.system-banner + .system-banner {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 배너 유형별 색상 */
.system-banner.MAINTENANCE {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.system-banner.NOTICE {
    background: linear-gradient(135deg, #2196f3, #1976d2);
}

.system-banner.UPDATE {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

/* ====================================
   배너 아이콘
   ==================================== */
.system-banner .banner-icon {
    font-size: 24px;
    flex-shrink: 0;
    opacity: 0.95;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

/* ====================================
   배너 내용
   ==================================== */
.system-banner .banner-content {
    flex: 1;
    min-width: 0;
}

.system-banner .banner-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system-banner .banner-text {
    font-size: 13px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 배너 기간 표시 */
.system-banner .banner-period {
    font-size: 12px;
    opacity: 0.85;
    flex-shrink: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
}

/* ====================================
   배너 버튼 그룹
   ==================================== */
.system-banner .banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.system-banner .banner-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.system-banner .banner-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.system-banner .banner-btn i {
    font-size: 18px;
}

/* ====================================
   접힌 상태 배너
   ==================================== */
.system-banner.collapsed {
    padding: 10px 24px;
}

.system-banner.collapsed .banner-content,
.system-banner.collapsed .banner-period {
    display: none;
}

.system-banner.collapsed .banner-title-collapsed {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

.banner-title-collapsed {
    display: none;
}

/* ====================================
   애니메이션
   ==================================== */
@keyframes bannerSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bannerSlideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.system-banner.hiding {
    animation: bannerSlideDown 0.3s ease forwards;
}

/* ====================================
   반응형 - 태블릿/모바일
   ==================================== */
@media (max-width: 768px) {
    .system-banner-footer {
        left: 0 !important;
    }

    .system-banner {
        padding: 12px 16px;
        gap: 12px;
    }

    .system-banner .banner-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }

    .system-banner .banner-title {
        font-size: 13px;
    }

    .system-banner .banner-text {
        font-size: 12px;
    }

    .system-banner .banner-period {
        display: none;
    }
}

/* ====================================
   배너가 있을 때 메인 콘텐츠 하단 여백
   ==================================== */
body.has-banner .main-content {
    padding-bottom: calc(var(--content-padding, 24px) + 70px);
}

body.has-multiple-banners .main-content {
    padding-bottom: calc(var(--content-padding, 24px) + 130px);
}

/* ====================================
   로그인 페이지용 배너 스타일
   ==================================== */
.system-banner-wrapper.login-page {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
}

.system-banner-wrapper.login-page .system-banner {
    justify-content: center;
    padding: 14px 24px;
}

.system-banner-wrapper.login-page .banner-icon {
    font-size: 24px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.system-banner-wrapper.login-page .banner-content {
    flex: 0 1 auto;
    max-width: 600px;
}

.system-banner-wrapper.login-page .banner-period {
    position: static;
}

/* ====================================
   기존 wrapper 호환성 (레거시)
   ==================================== */
.system-banner-wrapper {
    position: fixed;
    bottom: var(--footer-height, 56px);
    left: 0;
    right: 0;
    z-index: 1001;
    pointer-events: none;
}

.system-banner-wrapper > * {
    pointer-events: auto;
}

/* 사이드바 확장/축소 대응 (레거시) */
.sidebar-collapsed .system-banner-wrapper:not(.login-page) {
    left: var(--sidebar-collapsed-width, 78px);
}

body:not(.sidebar-collapsed) .system-banner-wrapper:not(.login-page) {
    left: var(--sidebar-width, 260px);
}
