/* Notices page - 7eys-AI 공지사항 (요구사항: 다크 퍼플 + 보라/핑크 그라데이션) */

/* 카테고리 필터 (Gallery 필터와 동일 패턴) */
.notice-filters {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.notice-filters li {
    cursor: pointer;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.notice-filters li:hover,
.notice-filters li.filter-active {
    background: #5e42a6;
    border-color: #5e42a6;
    color: #fff;
}

/* 타임라인 카드 리스트: 가로 약 3cm 더 길게(960px+약113px), 가로 화면 중앙 정렬 */
.notice-timeline {
    position: relative;
    max-width: 1074px;
    margin-left: auto;
    margin-right: auto;
}

.notice-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #6B4FBB 0%, rgba(194, 24, 91, 0.5) 100%);
    border-radius: 1px;
}

@media screen and (max-width: 640px) {
    .notice-timeline {
        margin-left: 1rem;
        margin-right: 1rem;
        max-width: 100%;
    }
    .notice-timeline::before {
        left: 12px;
    }
}

.notice-card {
    position: relative;
    padding: 1.25rem 1.5rem 1.25rem 3.5rem;
    margin-bottom: 1rem;
    background: rgba(45, 36, 71, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.notice-card:hover {
    background: rgba(45, 36, 71, 0.85);
    border-color: rgba(107, 79, 187, 0.4);
}

.notice-card .notice-card-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.notice-card .notice-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.notice-card .notice-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 0.25rem;
}

.notice-card .notice-badge.category-update { background: rgba(107, 79, 187, 0.5); color: #e0d4ff; }
.notice-card .notice-badge.category-event { background: rgba(194, 24, 91, 0.4); color: #ffcce0; }
.notice-card .notice-badge.category-maintenance { background: rgba(255, 193, 7, 0.25); color: #ffe082; }
.notice-card .notice-badge.category-general { background: rgba(255, 255, 255, 0.15); color: #fff; }

.notice-card .notice-badge.new-badge {
    background: linear-gradient(135deg, #C2185B 0%, #6B4FBB 100%);
    color: #fff;
}

.notice-card .notice-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

/* 더보기 전 요약글: 줄바꿈 적용한 기준으로 1줄만 표시 */
.notice-card .notice-card-excerpt {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.notice-card .notice-card-more {
    font-size: 0.85rem;
    color: #b39ddb;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.notice-card .notice-card-more:hover {
    color: #d1c4e9;
}

/* 카드 내 세로 펼침 영역 (더보기 → 인페이지 확장) */
.notice-card-expanded {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.notice-card.is-expanded .notice-card-expanded {
    display: block;
}

.notice-card.is-expanded .notice-card-more {
    display: none;
}

/* 닫기는 펼친 뒤에도 보이게 (더보기만 숨김) */
.notice-card.is-expanded .notice-card-more.notice-card-collapse {
    display: inline-flex;
}

.notice-card-expanded-body {
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

.notice-card-expanded-body p {
    margin: 0 0 0.75rem 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.notice-card-expanded-body ul,
.notice-card-expanded-body ol {
    margin: 0 0 0.75rem 1.5rem;
}

/* 내용이 짧아 더보기 없이 전체만 보이는 카드 */
.notice-card-full-only {
    margin-top: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

/* 닫기: 더보기와 동일 스타일( .notice-card-more 와 함께 사용 ) */
.notice-card-collapse {
    cursor: pointer;
}

.notice-card-collapse:focus-visible {
    outline: 2px solid #b39ddb;
    outline-offset: 2px;
}

.notice-loading-inline {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 타임라인 점 (선 왼쪽) */
.notice-card::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 1.75rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6B4FBB;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@media screen and (max-width: 640px) {
    .notice-card::before {
        left: 6px;
        top: 1.5rem;
        width: 10px;
        height: 10px;
    }
    .notice-card {
        padding-left: 2.5rem;
    }
}

/* 고정 공지 아이콘 */
.notice-card.is-pinned .notice-card-title {
    padding-left: 1.5rem;
}

.notice-card .notice-pin-icon {
    position: absolute;
    left: 2.75rem;
    top: 1.25rem;
    font-size: 0.9rem;
}

@media screen and (max-width: 640px) {
    .notice-card .notice-pin-icon {
        left: 2.25rem;
    }
}

/* 빈 상태 */
.notice-empty,
.notice-loading,
.notice-error {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
}

.notice-empty p,
.notice-error p {
    margin: 0.5rem 0 0 0;
}

/* 상세 모달 */
.notice-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.notice-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.notice-modal {
    background: linear-gradient(160deg, #2D2447 0%, #1a1530 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.notice-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.notice-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
    line-height: 1.35;
    flex: 1;
}

/* X만 여백 없이 감싸는 정원형 버튼 */
.notice-modal-close {
    flex-shrink: 0;
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.notice-modal-close:hover {
    background: rgba(194, 24, 91, 0.5);
}

.notice-modal-close:focus-visible {
    outline: 2px solid #b39ddb;
    outline-offset: 2px;
}

.notice-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.notice-modal-body .notice-detail-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.notice-modal-body .notice-detail-content {
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.notice-modal-body .notice-detail-content h1,
.notice-modal-body .notice-detail-content h2,
.notice-modal-body .notice-detail-content h3 {
    color: #fff;
    margin: 1rem 0 0.5rem 0;
}

.notice-modal-body .notice-detail-content p {
    margin: 0 0 0.75rem 0;
}

.notice-modal-body .notice-detail-content ul,
.notice-modal-body .notice-detail-content ol {
    margin: 0 0 0.75rem 1.5rem;
}

/* 반응형: 모바일에서 필터 가로 스크롤 가능 */
@media screen and (max-width: 480px) {
    .notice-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    .notice-filters li {
        flex-shrink: 0;
    }
}
