/**
 * board-shared.css
 * 게시판 공통 디자인 시스템
 */

:root {
    --board-primary: #c9a84c;
    --board-dark: #1a1a2e;
    --board-gray-bg: #f8f9fa;
    --board-border: #e9ecef;
    --board-text-main: #333;
    --board-text-muted: #888;
    --board-notice-bg: #fff9eb;
}

/* 게시판 컨테이너 */
.board-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

/* 게시판 헤더 */
.board-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--board-dark);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.board-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--board-dark);
    letter-spacing: -0.05em;
}

/* 검색바 영역 */
.board-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
}

.search-box {
    display: flex;
    background: #fff;
    border: 1px solid var(--board-border);
    border-radius: 4px;
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.search-box select {
    border: none;
    padding: 0 12px;
    background: #f1f3f5;
    outline: none;
    font-size: 14px;
}

.search-box input {
    border: none;
    padding: 10px 16px;
    flex: 1;
    outline: none;
    font-size: 14px;
}

.search-box button {
    background: var(--board-dark);
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: 0.2s;
}

.search-box button:hover {
    background: #000;
}

/* 게시판 테이블 스타일 */
.board-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 40px;
}

.board-table th {
    background: #f1f3f5;
    padding: 18px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--board-dark);
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.board-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--board-border);
    font-size: 15px;
    color: #444;
    text-align: center;
}

/* Pinned Notice Style */
.board-table tr.is-notice {
    background-color: var(--board-notice-bg);
}

.board-table tr.is-notice td {
    font-weight: 600;
}

.notice-badge {
    background: var(--board-primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

/* Title Link */
.board-table .title-cell {
    text-align: left;
    padding-left: 20px;
}

.board-table .title-cell a {
    color: var(--board-dark);
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-table .title-cell a:hover {
    color: var(--board-primary);
    text-decoration: underline;
}

/* New Badge */
.new-badge {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #ff4d4f;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-family: Arial, sans-serif;
}

/* Locked (Members Only) Premium UI */
.locked-container {
    text-align: center;
    padding: 80px 40px;
    background: #fff;
    border-radius: 24px;
    margin: 60px auto;
    max-width: 650px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.locked-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #c9a84c, #efd692, #c9a84c);
}

.locked-icon-circle {
    width: 100px;
    height: 100px;
    background: #fcf9f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    position: relative;
}

.locked-icon-circle i {
    font-size: 42px;
    color: #c9a84c;
    position: relative;
    z-index: 2;
}

.locked-icon-circle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid #c9a84c;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0.3;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }

    70% {
        transform: scale(1.3);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.locked-container h2 {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.locked-container p {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.8;
    word-break: keep-all;
}

.locked-container .btn-login-go {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 50px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(26, 26, 46, 0.2);
}

.locked-container .btn-login-go:hover {
    background: #c9a84c;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(201, 168, 76, 0.3);
}

.locked-container .btn-login-go i {
    font-size: 14px;
    transition: transform 0.3s;
}

.locked-container .btn-login-go:hover i {
    transform: translateX(5px);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .locked-container {
        padding: 60px 20px;
        margin: 30px 15px;
        border-radius: 20px;
    }

    .locked-container h2 {
        font-size: 22px;
    }

    .locked-container p {
        font-size: 14px;
    }

    .locked-icon-circle {
        width: 80px;
        height: 80px;
    }

    .locked-icon-circle i {
        font-size: 32px;
    }
}

/* Comment Count Badge */
.comment-count-badge {
    color: var(--board-primary);
    font-size: 13px;
    font-weight: 700;
    margin-left: 5px;
}

/* 작성 버튼 */
.btn-admin-action {
    background: var(--board-dark);
    color: #fff;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.btn-admin-action:hover {
    background: #000;
    transform: translateY(-2px);
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.pagination .page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--board-border);
    color: #666;
    font-size: 14px;
    transition: 0.2s;
    border-radius: 4px;
}

.pagination .page-link:hover {
    border-color: var(--board-primary);
    color: var(--board-primary);
}

.pagination .page-link.active {
    background: var(--board-primary);
    color: #fff;
    border-color: var(--board-primary);
}

/* 빈 상태 애니메이션 */
.empty-state {
    text-align: center;
    padding: 80px 0;
    color: var(--board-text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.2;
}

/* 모바일 대응 */
@media (max-width: 768px) {

    .board-table th:nth-child(1),
    .board-table td:nth-child(1),
    .board-table th:nth-child(4),
    .board-table td:nth-child(4) {
        display: none;
    }

    .board-header h2 {
        font-size: 24px;
    }
}

/* 상세 보기 페이지 스타일 */
.view-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px 100px;
}

.view-header {
    border-top: 2px solid var(--board-dark);
    padding: 30px 20px;
    background: #fcfcfc;
    border-bottom: 1px solid var(--board-border);
}

.view-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--board-dark);
    margin-bottom: 15px;
    line-height: 1.4;
}

.view-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--board-text-muted);
}

.view-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-files {
    padding: 15px 20px;
    background: #f1f3f5;
    border-bottom: 1px solid var(--board-border);
    font-size: 14px;
}

.view-files strong {
    margin-right: 15px;
    color: #495057;
}

.view-files ul {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
}

.view-files a {
    color: #228be6;
    text-decoration: none;
}

.view-files a:hover {
    text-decoration: underline;
}

.view-content {
    padding: 40px 20px;
    min-height: 300px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    border-bottom: 1px solid var(--board-border);
    white-space: pre-wrap;
    word-break: break-all;
}

.view-navigation {
    border-bottom: 1px solid var(--board-border);
}

.nav-item {
    display: flex;
    padding: 15px 20px;
    font-size: 14px;
    align-items: center;
}

.nav-item:first-child {
    border-bottom: 1px solid #f1f3f5;
}

.nav-item strong {
    width: 80px;
    color: #868e96;
}

.nav-item a {
    color: #444;
    text-decoration: none;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item a:hover {
    color: var(--board-primary);
}

.view-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.view-footer .right-btns {
    display: flex;
    gap: 10px;
}

.view-footer .admin-only-tools {
    display: flex;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid var(--board-border);
}

.btn-admin-small {
    background: #f1f3f5;
    color: #495057;
    border: 1px solid #ced4da;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-admin-small:hover {
    background: #e9ecef;
}

.btn-admin-small.active {
    background: var(--board-dark);
    color: #fff;
    border-color: var(--board-dark);
}

.hidden-alert {
    background: #fff5f5;
    color: #fa5252;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #ffa8a8;
}

.btn-list {
    background: #868e96;
    color: #fff;
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
}

/* --- 댓글 섹션 스타일 --- */
.comment-section {
    margin-top: 60px;
    border-top: 1px solid var(--board-border);
    padding-top: 40px;
}

.comment-header {
    margin-bottom: 25px;
}

.comment-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.comment-header h3 span {
    color: var(--board-primary);
}

.comment-list {
    margin-bottom: 40px;
}

.comment-item {
    padding: 20px 0;
    border-bottom: 1px solid #f1f3f5;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-author {
    font-weight: 700;
    color: var(--board-dark);
}

.comment-date {
    color: var(--board-text-muted);
    margin-left: 10px;
}

.comment-actions button {
    background: none;
    border: none;
    color: #fa5252;
    font-size: 12px;
    cursor: pointer;
}

.comment-actions button:hover {
    text-decoration: underline;
}

.comment-body {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    white-space: pre-wrap;
}

.comment-empty {
    text-align: center;
    padding: 40px 0;
    color: #aaa;
    font-size: 14px;
}

.comment-form-wrap {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--board-border);
    border-radius: 4px;
    padding: 15px;
    font-size: 14px;
    resize: none;
    outline: none;
}

.comment-form textarea:focus {
    border-color: var(--board-primary);
}

.btn-comment-submit {
    align-self: flex-end;
    background: var(--board-dark);
    color: #fff;
    padding: 10px 30px;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.comment-login-msg {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #666;
}

.comment-login-msg a {
    color: var(--board-primary);
    font-weight: 700;
    text-decoration: underline;
}

/* 영상 그리드 시스템 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: 0.3s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.video-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(201, 168, 76, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    opacity: 0;
    transition: 0.3s;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.video-info {
    padding: 20px;
}

.video-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-info p {
    font-size: 14px;
    color: #888;
}

/* 영상 미리보기 박스 */
.video-preview-box {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
    display: none;
}

.video-preview-box iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 추가 모바일 최적화 */
@media (max-width: 768px) {
    .board-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .board-info {
        text-align: right;
        font-size: 13px;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .view-title {
        font-size: 20px;
    }

    .view-meta {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .view-footer {
        flex-direction: column;
        gap: 10px;
    }

    .view-footer a,
    .view-footer button {
        width: 100%;
        text-align: center;
    }

    .admin-btns {
        flex-direction: column;
        width: 100%;
    }
}

/* 관리자 버튼 */
.admin-btns {
    display: flex;
    gap: 10px;
}

.btn-edit {
    background: var(--board-dark);
    color: #fff;
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.btn-delete {
    background: #fa5252;
    color: #fff;
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

/* 글쓰기 폼 스타일 */
.write-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px 100px;
}

.write-form {
    border-top: 2px solid var(--board-dark);
    padding-top: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--board-dark);
    margin-bottom: 10px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--board-border);
    border-radius: 4px;
    font-size: 15px;
    outline: none;
    transition: 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--board-primary);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.form-group textarea {
    min-height: 400px;
    line-height: 1.6;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    margin-top: 10px;
}

.form-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.file-list {
    margin-top: 10px;
    font-size: 13px;
    color: var(--board-text-muted);
}

.form-actions-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--board-border);
}

.btn-submit {
    background: var(--board-primary);
    color: #fff;
    padding: 12px 60px;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-submit:hover {
    background: #b8933e;
}

.btn-cancel {
    background: #e9ecef;
    color: #495057;
    padding: 12px 60px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
}