/* ================================================
 * notification.css — 알림 시스템 + 상단 네비 버튼 스타일
 * 🔔 버튼 + 드롭다운 리스트 + 상세 팝업
 * 📊 마이페이지 + ↩️ 로그아웃 아이콘 버튼
 * ================================================ */

/* ========================================
   0. 상단 네비 공통 아이콘 버튼
   ======================================== */
.nav-icon-btn {
    background: white;
    border: 2px solid #e5e7eb;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #555;
    transition: all 0.3s;
    flex-shrink: 0;
    position: relative;
}

.nav-icon-btn:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
}

/* 로그아웃 버튼: 호버 시 빨간색 */
.nav-icon-btn.nav-icon-logout:hover {
    border-color: #ef4444;
    color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

/* 툴팁 */
.nav-icon-btn::after {
    content: attr(title);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
}

.nav-icon-btn:hover::after {
    opacity: 1;
}

/* 모바일에서 툴팁 숨김 */
@media (max-width: 768px) {
    .nav-icon-btn::after {
        display: none;
    }
    .nav-icon-btn {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }
}

/* ========================================
   1. 🔔 벨 버튼
   ======================================== */
.notif-wrapper {
    position: relative;
}

/* 벨 버튼은 nav-icon-btn 클래스를 공유하고, 뱃지용 position만 추가 */
.notif-bell-btn {
    position: relative;
}

/* 빨간 뱃지 */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* 뱃지 숨김 (읽지 않은 알림 0개) */
.notif-badge.hidden {
    display: none;
}

/* ========================================
   2. 드롭다운 리스트
   ======================================== */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    z-index: 9999;
    overflow: hidden;
    animation: notifSlideDown 0.2s ease;
}

.notif-dropdown.show {
    display: block;
}

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

/* 드롭다운 헤더 */
.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.notif-dropdown-header > span:first-child {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.notif-dropdown-count {
    font-size: 12px;
    color: #6c5ce7;
    font-weight: 600;
}

/* 드롭다운 리스트 영역 */
.notif-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
}

/* 알림 없을 때 */
.notif-empty {
    padding: 32px 20px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

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

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

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

/* 읽지 않은 알림 배경 */
.notif-item.notif-unread {
    background: #f0edff;
}

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

/* 파란 점 (읽지 않음 표시) */
.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c5ce7;
    margin-top: 6px;
    flex-shrink: 0;
}

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

.notif-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-item-time {
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}

/* ========================================
   3. 상세 팝업 오버레이
   ======================================== */
.notif-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: notifFadeIn 0.2s ease;
}

.notif-popup-overlay.show {
    display: flex;
}

@keyframes notifFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 팝업 카드 */
.notif-popup {
    background: #fff;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    animation: notifPopupSlide 0.25s ease;
}

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

/* 팝업 헤더 */
.notif-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 0;
    gap: 16px;
}

.notif-popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    flex: 1;
}

.notif-popup-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 8px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.notif-popup-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* 팝업 메타 (발송자, 시간) */
.notif-popup-meta {
    padding: 8px 24px 16px;
    font-size: 13px;
    color: #999;
    border-bottom: 1px solid #f0f0f0;
}

/* 팝업 본문 */
.notif-popup-body {
    padding: 20px 24px;
    font-size: 15px;
    line-height: 1.75;
    color: #333;
    overflow-y: auto;
    flex: 1;
    word-break: keep-all;
}

/* 팝업 푸터 */
.notif-popup-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: center;
    border-top: 1px solid #f0f0f0;
}

.notif-popup-confirm {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 12px 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.notif-popup-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
}

/* ========================================
   4. 모바일 반응형
   ======================================== */
@media (max-width: 768px) {
    .notif-dropdown {
        width: 280px;
        right: -60px;
    }

    .notif-popup {
        max-width: 100%;
        border-radius: 16px;
        max-height: 85vh;
    }

    .notif-popup-title {
        font-size: 16px;
    }

    .notif-popup-body {
        font-size: 14px;
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .notif-dropdown {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        width: auto;
    }
}
