
/* 이미지 확대 모달 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.image-modal.active {
    display: flex;
}

.image-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.image-modal-close:hover {
    opacity: 1;
}

/* 신청정보 표 (cash-event / losing-event 자동 생성 표) — 은은한 에메랄드 헤더 */
.view-content table { border-collapse: collapse; }

/* 다크모드 — 옛 에디터(<font color="#000000"> 등)로 본문에 박힌 검정 글씨가
   어두운 배경에서 안 보이는 문제 보정. 검정 계열만 본문색으로 올리고 강조 컬러(빨강 등)는 보존.
   공지사항 글이 대부분 이 패턴이라 다크모드에서 글씨가 안 보였음. */
[data-theme="dark"] .view-content font[color="#000000"],
[data-theme="dark"] .view-content font[color="#000"],
[data-theme="dark"] .view-content font[color="black"],
[data-theme="dark"] .view-content [style*="color:#000000"],
[data-theme="dark"] .view-content [style*="color: #000000"],
[data-theme="dark"] .view-content [style*="rgb(0, 0, 0)"],
[data-theme="dark"] .view-content [style*="rgb(0,0,0)"] {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .view-content .app-info-th,
[data-theme="dark"] .view-content table th[style*="background:#f5f5f5"],
[data-theme="dark"] .view-content table th[style*="background: #f5f5f5"] {
    background: rgba(20, 184, 166, 0.12) !important;
    color: #6db142 !important;
    border: 1px solid rgba(20, 184, 166, 0.25) !important;
}
[data-theme="dark"] .view-content .app-info-td,
[data-theme="dark"] .view-content table td {
    color: var(--text-primary); /* 다크모드: 검정(#333) → 본문색. 어두운 배경에 검정글씨라 안 보이던 문제 수정 */
    border: 1px solid #2a3441;
}
[data-theme="dark"] .view-content table { border-color: #2a3441 !important; }
/* 1~6번째 행 헤더(th) — 에메랄드 강조 (다크/라이트 공통) */
.view-content table > tbody > tr:nth-child(-n+6) > th {
    background: rgba(20, 184, 166, 0.18) !important;
    color: #1ea459 !important;
    border: 1px solid rgba(20, 184, 166, 0.4) !important;
    font-weight: 700;
}
[data-theme="light"] .view-content table > tbody > tr:nth-child(-n+6) > th {
    background: rgba(20, 184, 166, 0.12) !important;
    color: #17833f !important;
    border: 1px solid rgba(20, 184, 166, 0.35) !important;
}
/* 2번째 행 헤더(th) — 한 줄로 표시 (줄바꿈 방지) */
.view-content table > tbody > tr:nth-child(2) > th {
    white-space: nowrap !important;
}
/* 1~6번째 행 값(td) — th와 동일한 에메랄드 톤 테두리로 행마다 칸 구분선이 또렷이 보이도록 */
.view-content table > tbody > tr:nth-child(-n+6) > td,
.view-content .app-info-td {
    border: 1px solid rgba(20, 184, 166, 0.3) !important;
}
[data-theme="light"] .view-content table > tbody > tr:nth-child(-n+6) > td,
[data-theme="light"] .view-content .app-info-td {
    border: 1px solid rgba(20, 184, 166, 0.22) !important;
}
[data-theme="light"] .view-content .app-info-th,
[data-theme="light"] .view-content table th[style*="background:#f5f5f5"],
[data-theme="light"] .view-content table th[style*="background: #f5f5f5"] {
    background: rgba(20, 184, 166, 0.08) !important;
    color: #0f766e !important;
    border: 1px solid rgba(20, 184, 166, 0.25) !important;
}

/* 작성자 정보 바 — 다크모드에서 배경(--bg-tertiary #1a222c)과 테두리(--border-dark #1e293b)가
   거의 같은 색이라 구분선이 안 보임 → 더 밝은 테두리로 또렷하게 */
/* 작성자 정보 바 — 다크모드 칸칸 구분선 */
[data-theme="dark"] .author-info-bar {
    border-color: #6b7280;
}
/* 그룹(작성자 / 통계 / 날짜·조회) 사이 세로 구분선 */
[data-theme="dark"] .author-info-bar .author-stats-inline,
[data-theme="dark"] .author-info-bar .post-meta-right {
    border-left: 1px solid #6b7280;
    padding-left: 16px;
}
/* 통계 내부 "|" 구분자도 또렷한 회색으로 */
[data-theme="dark"] .author-info-bar .stat-divider {
    color: #9ca3af;
}
@media (max-width: 768px) {
    /* 세로 배치에선 좌측 세로선 제거 */
    [data-theme="dark"] .author-info-bar .author-stats-inline,
    [data-theme="dark"] .author-info-bar .post-meta-right {
        border-left: none;
        padding-left: 0;
    }
}

/* 게시글 본문 이미지 — 텍스트와 같은 줄에 붙지 않게 자기 줄 차지(block) + 비율 유지 */
.view-content img {
    transition: opacity 0.2s;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
}

.view-content img:hover {
    opacity: 0.85;
}

/* 게시글 본문 내 비디오/iframe 반응형 */
.view-content iframe,
.view-content video {
    max-width: 100%;
    border: none;
    border-radius: 8px;
}

.view-content .video-embed,
.view-content .note-video-clip {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 16px 0;
    border-radius: 8px;
    background: #000;
}

.view-content .video-embed iframe,
.view-content .note-video-clip iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== 비밀댓글 (포인트 거래 게시판 등) ===== */
.trade-secret-notice {
    margin: 0 0 12px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(20,184,166,0.08), rgba(15,23,42,0.4));
    border: 1px solid rgba(20,184,166,0.35);
    border-left-width: 3px;
    border-radius: 8px;
    font-size: 12.5px;
    color: #555555;
    line-height: 1.55;
}
.trade-secret-notice b { color: #1ea459; font-weight: 700; }
.secret-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(251,191,36,0.14);
    color: #a16207;
    border: 1px solid rgba(251,191,36,0.45);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    vertical-align: middle;
}
.comment-content.is-masked {
    padding: 10px 12px;
    background: rgba(100,116,139,0.10);
    border: 1px dashed rgba(100,116,139,0.4);
    border-radius: 6px;
}
.secret-comment-mask {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888888;
    font-size: 12.5px;
    font-style: italic;
}

/* ===== 포인트 거래 (P2P) — 판매 정보 박스 + 거래완료 모달 ===== */
.trade-info-box {
    margin: 14px 0 18px;
    padding: 16px 18px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(20,184,166,0.10), rgba(15,23,42,0.4));
    border: 1px solid rgba(20,184,166,0.35);
}
.trade-info-box.completed {
    background: linear-gradient(180deg, rgba(100,116,139,0.10), rgba(15,23,42,0.4));
    border-color: rgba(100,116,139,0.35);
    opacity: 0.85;
}
.trade-info-row {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
}
.trade-info-row .btn-trade-complete { margin-left: auto; }
@media (max-width: 560px) {
    .trade-info-row .btn-trade-complete { margin-left: 0; width: 100%; }
}
.trade-info-label {
    font-size: 12px; font-weight: 700; color: #888888;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.trade-info-value {
    font-size: 22px; font-weight: 800; color: #1ea459;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 12px rgba(94,234,212,0.3);
}
.trade-info-box.completed .trade-info-value { color: #888888; text-shadow: none; }
.trade-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 700;
    letter-spacing: 0.3px;
}
.trade-status-badge.trade-open {
    background: rgba(20,184,166,0.18);
    color: #1ea459;
    border: 1px solid rgba(20,184,166,0.5);
}
.trade-status-badge.trade-completed {
    background: rgba(100,116,139,0.18);
    color: #555555;
    border: 1px solid rgba(100,116,139,0.5);
}
.trade-info-hint {
    margin-top: 10px;
    font-size: 12.5px; line-height: 1.55;
    color: #888888;
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(251,191,36,0.5);
}
.btn-trade-complete {
    padding: 9px 16px;
    background: linear-gradient(180deg, #1ea459, #17833f);
    color: #fff; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: opacity 0.15s, transform 0.05s;
    white-space: nowrap;
}
.btn-trade-complete:hover { opacity: 0.92; }
.btn-trade-complete:active { transform: translateY(1px); }

/* 거래완료 모달 */
.trade-complete-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center;
    z-index: 100000;
    padding: 16px;
}
.trade-complete-modal-backdrop.open { display: flex; }
.trade-complete-modal {
    background: linear-gradient(180deg, #ffffff, #f5f5f5);
    border: 1px solid rgba(20,184,166,0.35);
    border-radius: 14px;
    width: 100%; max-width: 460px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55);
    overflow: hidden;
}
.tcm-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex; justify-content: space-between; align-items: center;
}
.tcm-title { font-size: 15px; font-weight: 700; color: #1ea459; }
.tcm-close { background: none; border: none; color: #888888; font-size: 22px; cursor: pointer; }
.tcm-body { padding: 20px; color: #555555; font-size: 13.5px; line-height: 1.6; }
.tcm-info {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 12.5px;
}
.tcm-info b { color: #1ea459; font-weight: 800; }
.tcm-label { display: block; font-size: 12px; font-weight: 600; color: #888888; margin-bottom: 6px; }
.tcm-select {
    width: 100%; padding: 10px 12px;
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px; color: #5a5a5a; font-size: 13px;
    font-family: inherit;
}
.tcm-select:focus { outline: none; border-color: rgba(20,184,166,0.5); }
.tcm-hint { font-size: 11.5px; color: #888888; margin-top: 8px; line-height: 1.5; }
.tcm-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex; gap: 8px; justify-content: flex-end;
    background: rgba(0,0,0,0.05);
}
.tcm-btn { padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.tcm-btn.cancel { background: rgba(0,0,0,0.06); color: #555555; }
.tcm-btn.cancel:hover { background: rgba(0,0,0,0.12); }
.tcm-btn.confirm { background: #1ea459; color: #fff; }
.tcm-btn.confirm:hover:not(:disabled) { background: #17833f; }
.tcm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
