/* 알림 모달 - #notice_modal.common-modal 사용하여 specificity를 높여 !important 최소화 */
#notice_modal.common-modal {
    position: absolute;
    top: 60px;
    right: 20px;
    left: auto;
    transform: none;
    width: 380px;
    max-height: 600px;
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: var(--border-radius-base);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden; /* 헤더 sticky를 위해 내부 container에서 scroll 관리하거나 전체 scroll */
    display: flex;
    flex-direction: column;
}

/* 헤더 영역 */
.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--main-item-border-color);
    margin-right : 40px;
    background: var(--white);
    flex-shrink: 0;
}

.notify-title {
    font-size: var(--text-lg);
    font-weight: 800;
}

.notify-all-mark-read {
    font-size: var(--text-sm);
    color: var(--primary-button-blue-color);
    cursor: pointer;
    font-weight: 600;
}

.notify-all-mark-read:hover {
    text-decoration: underline;
}

/* 리스트 컨테이너 */
.notice-list-container {
    overflow-y: auto;
    flex-grow: 1;
}

/* 그룹 헤더 (오늘 받은 알림, 이전 알림) */
.notice-group-header {
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: #fcfcfc;
    font-size: 12px;
    font-weight: 800;
    color: var(--silver-text-color);
    border-bottom: 1px solid var(--main-item-border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

/* 알림 카드 스타일 */
.notification-card-wrap {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s, opacity 0.3s, transform 0.3s;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .notification-card-wrap:hover {
        background-color: #f8f9fa;
    }
}

/* 읽지 않은 알림 강조 */
.notification-card-wrap.unread {
    background-color: #f0f7ff;
}

.notification-card-wrap.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-button-blue-color);
}

.notice-card-content {
    display: flex;
    padding: 12px 14px;
    gap: 12px;
}

/* 왼쪽: 프로필 및 타입 아이콘 */
.card-left {
    flex-shrink: 0;
}

.thumb {
    position: relative;
    width: 44px;
    height: 44px;
    margin: 0;
}

.thumb-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--skinThumbBorder);
}

.type-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 중앙: 알림 내용 */
.card-body {
    flex-grow: 1;
    min-width: 0;
}

.notice-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notice-text {
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--primary-color);
    word-break: break-all;
    display: flex;
    align-items: center;
}

/* 안읽은 알림 파란 점 표시 */
.unread-dot-indicator {
    color: var(--primary-button-blue-color);
    font-size: 10px;
    margin-right: 6px;
    flex-shrink: 0;
}

.sender-nickName {
    font-weight: 800;
    margin-right: 4px;
}

.notice-preview {
    font-size: var(--text-xs);
    color: var(--silver-text-color);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notice-time {
    font-size: var(--text-xs);
    color: var(--light-grey-text-color);
    margin-top: 4px;
}

/* 오른쪽: 삭제 버튼 */
.card-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0.3; /* 기본적으로 살짝 보이게 (마치 보조 정보처럼) */
    transition: opacity 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .notification-card-wrap:hover .card-right {
        opacity: 1; /* 호버 시에만 뚜렷하게 */
    }
}

.notify-delete-btn {
    background: none;
    border: none;
    color: var(--light-grey-text-color);
    padding: 8px;
    cursor: pointer;
    border-radius: var(--border-radius-xs);
    display: flex; /* SVG 정렬을 위해 추가 */
    align-items: center;
    justify-content: center;
}

.notify-delete-btn .svg-icon {
    stroke: var(--light-grey-text-color); /* 명시적으로 색상 지정 */
    transition: stroke 0.2s;
}

.notify-delete-btn:hover {
    background-color: #eee;
}

.notify-delete-btn:hover .svg-icon {
    stroke: var(--error-color); /* 호버 시 빨간색으로 변경 */
}

/* 읽음 상태 (Visited) */
.notification-card-wrap.visited {
    background-color: transparent;
}

.notification-card-wrap.visited .notice-text,
.notification-card-wrap.visited .sender-nickName,
.notification-card-wrap.visited .notice-preview {
    color: var(--light-grey-text-color);
}

.notification-card-wrap.visited .thumb-img {
    filter: grayscale(0.5) opacity(0.7);
}

/* 푸터 및 빈 메시지 */
.notice-bottom-area {
    padding: var(--spacing-base);
    border-top: 1px solid var(--main-item-border-color);
    flex-shrink: 0;
}

.more-text {
    font-size: var(--text-xs);
    color: var(--light-grey-text-color);
    text-align: center;
}

.notice-empty-msg {
    padding: var(--spacing-2xl) var(--spacing-lg);
    text-align: center;
    color: var(--light-grey-text-color);
    font-size: var(--text-sm);
}

/* 모바일 대응 */
@media (max-width: 767px) {
    #notice_modal.common-modal {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 86px);
        max-height: none;
        margin: 0;
        border-radius: 0;
        z-index: 2000;
        bottom: 86px; /* 하단 메뉴바 등 고려 */
    }
    
    .notice-header {
        padding: var(--spacing-base) var(--spacing-md);
    }

    .card-right {
        opacity: 1; /* 모바일은 항상 노출 */
    }
}
