/* ----- Header shell ----- */
.header_bar{
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100%;
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(16px, 5vw, 64px);
    box-sizing: border-box;
    background: var(--topbar, #C6DEFD);
    box-shadow: 0 12px 30px rgba(37, 67, 135, 0.18);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.header_bar--hidden{
    transform: translateY(-100%);
    box-shadow: none;
}

.header_bar__logobox{
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header_bar__logobox a{
    color: #3B82F6;
    font-size: clamp(28px, 4vw, 37px);
    font-weight: 700;
    text-transform: capitalize;
}

.header_bar__nav{
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 12px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.35);
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    backdrop-filter: blur(7px);
    -webkit-overflow-scrolling: touch;
}

.header_bar__nav__box{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 999px;
    font-family: "Poppins", "Outfit", "Noto Sans KR", sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: rgba(244, 255, 243, 0.82);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}

.header_bar__nav__box.is-active{
    background: transparent;
    color: #3B82F6;
    box-shadow: none;
}

.header_bar__nav__box:hover{
    color: #ffffff;
}

.header_bar__nav__box.is-highlighted{
    color: #3B82F6;
}

.header_bar__nav-indicator{
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.25);
    pointer-events: none;
    transition: transform 0.35s ease, width 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    transform: translateX(0);
}

.header_bar__nav-indicator.is-visible{
    opacity: 1;
}

.header_bar__nav-indicator.is-teleport{
    transition: none !important;
}

.header_bar__useraction{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #252B61;
}

.header_bar__date{
    font-weight: 700;
}

.header_bar__notif{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(37, 43, 97, 0.4);
    background: rgba(255, 255, 255, 0.65);
    color: #252B61;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: capitalize;
    cursor: pointer;
}

.header_bar__notif-dot{
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(45deg, #70D4FF 46%, #FF7D7D 49%);
    border: 1px solid #252B61;
}

/* 알림 읽지 않음 표시 */
.header_bar__notif-dot.has-unread {
    background: #ff4757;
    animation: notif-pulse 1.5s infinite;
}

@keyframes notif-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* ===== 알림 팝업 ===== */
.notif-popup {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(37, 67, 135, 0.25);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.notif-popup.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    color: #fff;
    flex-shrink: 0;
}

.notif-popup__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-popup__delete-all {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.notif-popup__delete-all:hover {
    background: rgba(255, 255, 255, 0.3);
}

.notif-popup__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.notif-popup__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.notif-popup__close:hover {
    opacity: 1;
}

.notif-popup__body {
    flex: 1;
    max-height: 350px;
    overflow-y: auto;
}

.notif-popup__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #94a3b8;
    text-align: center;
}

.notif-popup__empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.notif-popup__empty-text {
    font-size: 14px;
    margin: 0;
}

/* 알림 팝업 아이템 (notification-timer에서 추가) */
.notif-popup__item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.3s, transform 0.3s;
    cursor: pointer;
    animation: slideIn 0.3s ease;
}

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

.notif-popup__item:hover {
    background: #f8fafc;
}

.notif-popup__item:last-child {
    border-bottom: none;
}

.notif-popup__item--new {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    animation: pulse 0.5s ease-in-out 3;
}

@keyframes pulse {
    0%, 100% { background: linear-gradient(135deg, #fef3c7, #fde68a); }
    50% { background: linear-gradient(135deg, #fde68a, #fbbf24); }
}

.notif-popup__item-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.notif-popup__item-content {
    flex: 1;
    min-width: 0;
}

.notif-popup__item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.notif-popup__item-body {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.notif-popup__item-time {
    font-size: 11px;
    color: #94a3b8;
}

.notif-popup__item-delete {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
}

.notif-popup__item:hover .notif-popup__item-delete {
    opacity: 1;
}

.notif-popup__item-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* 알림 아이템 */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
    cursor: pointer;
}

.notif-item:hover {
    background: #f8fafc;
}

.notif-item:hover .notif-popup__item-delete {
    opacity: 1;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item.is-unread {
    background: #eff6ff;
}

.notif-item.is-unread:hover {
    background: #dbeafe;
}

.notif-item__icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.notif-item__icon--success {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.notif-item__icon--warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.notif-item__icon--info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.notif-item__icon--error {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.notif-item__content {
    flex: 1;
    min-width: 0;
}

.notif-item__title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.notif-item__body {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item__time {
    font-size: 11px;
    color: #94a3b8;
    margin: 0;
}

/* 알림 푸터 */
.notif-popup__footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.notif-popup__read-all {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.notif-popup__read-all:hover {
    background: #eff6ff;
}

/* 알림 버튼 래퍼 (position relative 필요) */
.header_bar__notif-wrapper {
    position: relative;
}

/* ===== 알림 탭 스타일 ===== */
.notif-popup__tabs {
    display: flex;
    gap: 4px;
}

.notif-popup__tab {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-popup__tab:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.notif-popup__tab.is-active {
    background: rgba(255, 255, 255, 0.95);
    color: #3b82f6;
}

/* 컨텐츠 영역 */
.notif-popup__content {
    display: block;
}

.notif-popup__content--hidden {
    display: none !important;
}

/* ===== 알림 설정 스타일 ===== */
.notif-settings {
    padding: 20px;
}

.notif-settings__section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.notif-settings__section:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
}

.notif-settings__title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
}

.notif-settings__desc {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.notif-settings__field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.notif-settings__field:last-child {
    margin-bottom: 0;
}

.notif-settings__field--sub {
    padding-left: 16px;
    border-left: 3px solid #e2e8f0;
    margin-left: 4px;
}

.notif-settings__label {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    flex-shrink: 0;
}

.notif-settings__input-group {
    flex: 0 0 auto;
}

.notif-settings__select {
    padding: 10px 36px 10px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2.5 4L6 7.5 9.5 4'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    min-width: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.notif-settings__select:hover {
    border-color: #cbd5e1;
}

.notif-settings__select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 토글 스위치 */
.notif-settings__toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.notif-settings__checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.notif-settings__toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: all 0.3s ease;
}

.notif-settings__toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.notif-settings__checkbox:checked + .notif-settings__toggle-slider {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

.notif-settings__checkbox:checked + .notif-settings__toggle-slider::before {
    transform: translateX(24px);
}

.notif-settings__checkbox:focus + .notif-settings__toggle-slider {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 저장 버튼 */
.notif-settings__actions {
    margin-top: 20px;
}

.notif-settings__save-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.notif-settings__save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.notif-settings__save-btn:active {
    transform: translateY(0);
}

/* 상태 메시지 */
.notif-settings__status {
    margin-top: 12px;
    padding: 0;
    font-size: 13px;
    text-align: center;
    min-height: 20px;
    transition: all 0.2s ease;
}

.notif-settings__status--loading {
    color: #64748b;
}

.notif-settings__status--success {
    color: #10b981;
    font-weight: 600;
}

.notif-settings__status--error {
    color: #ef4444;
    font-weight: 600;
}

/* 반응형 */
@media (max-width: 480px) {
    .notif-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    
    .notif-popup.is-open {
        transform: translateY(0);
    }
}

.header_bar__useraction__logintext{
    font-weight: 700;
    text-transform: capitalize;
    color: #252B61;
    text-decoration: none;
}

/* 로그아웃 버튼 */
.header_bar__logout{
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(37,43,97,0.35);
    background: linear-gradient(135deg,#ffffff 0%, #f3f6ff 100%);
    color: #252B61;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: background .25s ease, box-shadow .25s ease, color .25s ease;
}
.header_bar__logout:hover{
    background: #3B82F6;
    color:#fff;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
}

@media (min-width: 769px) and (max-width: 1024px) {
    .header_bar{
        padding: 16px clamp(20px, 6vw, 48px);
        flex-wrap: wrap;
        row-gap: 16px;
    }
    .header_bar__nav{
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 14px;
        padding: 10px 14px;
    }
    .header_bar__nav__box{
        padding: 8px 18px;
    }
    .header_bar__useraction{
        order: 2;
        width: 100%;
        justify-content: flex-end;
    }
    .header_bar__nav-indicator{
        top: 5px;
        bottom: 5px;
    }
}

@media (max-width: 768px) {
    .header_bar{
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 14px 18px;
    }
    .header_bar__nav{
        order: 3;
        width: 100%;
        padding: 8px 10px;
        border-radius: 18px;
        gap: 10px;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .header_bar__nav__box{
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 14px;
    }
    .header_bar__useraction{
        order: 2;
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }
    .header_bar__nav-indicator{
        top: 4px;
        bottom: 4px;
    }
}