/* ================================================
   통합 스타일시트 (view_skin + list_skin + style)
   뷰스킨·리스트스킨 <style> 블록을 이 파일로 통합
================================================ */

/* -----------------------------------------------
   0. CSS 변수 (라이트/다크 공용)
----------------------------------------------- */
:root {
    --card-bg: #ffffff;
    --card-border: #f0f0f0;
    --text-main: #212529;
    --text-muted: #666666;
    --point-color: #ff4e00;
}

[data-bs-theme="dark"] {
    --card-bg: #1e1e1e;
    --card-border: #333333;
    --text-main: #eeeeee;
    --text-muted: #aaaaaa;
}


/* -----------------------------------------------
   1. 뷰 페이지 레이아웃 (#bo_v)
----------------------------------------------- */
header.py-3.d-none.d-xl-block {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
}

article#bo_v {
    background-color: #ffffff !important;
    color: #333 !important;
    max-width: 1000px;
    margin: 30px auto;
    padding: 30px 40px;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    border: 1px solid #e1e1e1 !important;
    position: relative !important;
    z-index: 1;
}

#bo_v header {
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

#bo_v_title {
    color: #000 !important;
    margin-top: 0;
    font-size: 1.8rem;
}

.bo_v_info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
    padding: 10px 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#bo_v_con {
    font-size: 1.05rem;
    min-height: 100px;
    color: inherit;
    word-break: break-all;
    margin-bottom: 50px;
}


/* -----------------------------------------------
   2. 유튜브 영상 래퍼
----------------------------------------------- */
.video-wrapper {
    position: relative;
    padding-bottom: 60%;
    height: 0;
    overflow: hidden;
    background: #000;
    margin: 20px auto !important;
    display: block !important;
    clear: both;
    border-radius: 8px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 쇼츠 */
.video-wrapper.shorts {
    padding-bottom: 0 !important;
    height: auto !important;
    max-width: 400px !important;
    aspect-ratio: 9 / 16;
    margin: 20px auto !important;
    border-radius: 12px;
}

/* 출처 박스 */
.video-source-box {
    margin: 10px 0 20px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #ff4e00;
    font-size: 0.85rem;
}

.video-source {
    margin-top: -10px;
    margin-bottom: 20px;
    text-align: right;
    font-size: 12px;
    color: #888;
}


/* -----------------------------------------------
   3. 추천/비추천 버튼
----------------------------------------------- */
#bo_v_act {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px !important;
    margin: 40px auto !important;
}

#bo_v_act a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 80px !important;
    height: 80px !important;
    border-radius: 50% !important;
    border: 2px solid #e0e0e0 !important;
    background: #fafafa !important;
    text-decoration: none !important;
    color: #555 !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
}

#bo_v_act a i {
    font-size: 1.4rem !important;
    line-height: 1 !important;
}

#bo_v_act a strong {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

/* 추천 hover */
#bo_v_act a.bo_v_good:hover {
    background: #fff3ee !important;
    border-color: #ff4e00 !important;
    color: #ff4e00 !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 14px rgba(255,78,0,0.2) !important;
}

/* 비추천 hover */
#bo_v_act a.bo_v_nogood:hover {
    background: #f0f4ff !important;
    border-color: #4e8aff !important;
    color: #4e8aff !important;
    transform: scale(1.08) !important;
    box-shadow: 0 4px 14px rgba(78,138,255,0.2) !important;
}


/* -----------------------------------------------
   4. 하단 버튼 목록 (수정/삭제/목록/글쓰기)
----------------------------------------------- */
.bo_v_com {
    list-style: none;
    padding: 20px 0 !important;
    margin: 30px 0 !important;
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid #eee;
    clear: both;
}

.bo_v_com li a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333 !important;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
}


/* -----------------------------------------------
   5. 이전글/다음글 네비게이션
----------------------------------------------- */
.v-nav {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 30px 0;
    padding: 5px 0;
    border-radius: 8px;
    overflow: hidden;
}

.v-nav-item {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    font-size: 0.95rem;
    transition: background 0.18s, padding-left 0.18s;
    border-radius: 6px;
    cursor: pointer;
}

.v-nav-item:hover {
    background: #fff3ee;
    padding-left: 20px;
}

.v-nav-item:hover .v-nav-label {
    color: #cc3a00;
}

.v-nav-item:hover .v-nav-link {
    color: #ff4e00 !important;
}

.v-nav-label {
    width: 75px;
    font-weight: 700;
    font-size: 0.82rem;
    color: #ff4e00;
    flex-shrink: 0;
    transition: color 0.18s;
}

.v-nav-link {
    flex: 1;
    text-decoration: none !important;
    color: #444 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.18s;
}


/* -----------------------------------------------
   6. 리스트 페이지 카드
----------------------------------------------- */
.video-card {
    background: var(--card-bg) !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    margin-bottom: 25px;
    border: 1px solid var(--card-border) !important;
    position: relative;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* 썸네일 - 유튜브 hqdefault 레터박스 제거, 꽉 채우기 */
.video-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #111;
    overflow: hidden;
}

.video-thumb-wrap img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 108%; /* hqdefault 레터박스(검정 띠) 잘라내기 */
    object-fit: cover;
}

.video-hit-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.6);
    font-size: 2.5rem;
    transition: 0.3s;
}

.video-card:hover .video-play-btn { color: #ff0000; }

.video-info { padding: 12px; }

.video-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 관리자 체크박스 */
.gall_chk {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 20;
    background: rgba(255,255,255,0.8);
    padding: 3px;
    border-radius: 4px;
}

.admin-control-bar {
    margin: 20px 0;
    padding: 15px;
    background: var(--card-border) !important;
    border-radius: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


/* -----------------------------------------------
   7. 아이폰 사파리 강제 반전 방지
----------------------------------------------- */
[data-bs-theme="light"] #bo_v_title,
[data-bs-theme="light"] .video-title,
[data-bs-theme="light"] .pg_wrap a,
[data-bs-theme="light"] .pg_wrap b {
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
}

[data-bs-theme="dark"] #bo_v_title,
[data-bs-theme="dark"] .video-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}


/* -----------------------------------------------
   8. 다크모드 - 뷰 페이지
----------------------------------------------- */
[data-bs-theme="dark"] article#bo_v {
    background-color: #252525 !important;
    color: #eee !important;
    border: 1px solid #333 !important;
}

[data-bs-theme="dark"] #bo_v > header,
[data-bs-theme="dark"] #bo_v_atc {
    background: transparent !important;
}

[data-bs-theme="dark"] #bo_v .card,
[data-bs-theme="dark"] #bo_v .view-card,
[data-bs-theme="dark"] #bo_v .main-section,
[data-bs-theme="dark"] #bo_v .custom-tab-main-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

[data-bs-theme="dark"] #bo_v,
[data-bs-theme="dark"] #bo_v header,
[data-bs-theme="dark"] #bo_v_atc,
[data-bs-theme="dark"] .bo_v_info,
[data-bs-theme="dark"] .bo_v_com {
    border-color: #222 !important;
}

[data-bs-theme="dark"] .bo_v_info {
    border-bottom: 1px solid #333 !important;
    color: #bbbbbb !important;
}

[data-bs-theme="dark"] .v-nav-item:hover {
    background: #1e1208 !important;
}

[data-bs-theme="dark"] .v-nav-item:hover .v-nav-link {
    color: #ff7033 !important;
}

[data-bs-theme="dark"] .v-nav-link {
    color: #ccc !important;
}

[data-bs-theme="dark"] #bo_v_act a {
    background: #1e1e1e !important;
    border: 2px solid #333 !important;
    color: #cccccc !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

[data-bs-theme="dark"] #bo_v_act a.bo_v_good:hover {
    background: #1e1208 !important;
    border-color: #ff4e00 !important;
    color: #ff4e00 !important;
}

[data-bs-theme="dark"] #bo_v_act a.bo_v_nogood:hover {
    background: #0d1226 !important;
    border-color: #4e8aff !important;
    color: #4e8aff !important;
}

[data-bs-theme="dark"] .bo_v_com li a {
    background: #222 !important;
    border-color: #444 !important;
    color: #eee !important;
}

[data-bs-theme="dark"] .video-source-box {
    background: #252525;
    border-color: #ff4e00;
    color: #aaa;
}

[data-bs-theme="dark"] .video-source { color: #aaaaaa !important; }


/* -----------------------------------------------
   9. 다크모드 - 리스트 페이지
----------------------------------------------- */
[data-bs-theme="dark"] .video-card {
    background-color: var(--card-bg) !important;
    border-color: #333 !important;
}


/* -----------------------------------------------
   10. 다크모드 - 공통 UI
----------------------------------------------- */
[data-bs-theme="dark"] header,
[data-bs-theme="dark"] .navbar {
    border-bottom: 1px solid #222 !important;
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-body {
    border-color: #222 !important;
    background-color: #1a1a1a !important;
}


/* -----------------------------------------------
   11-A. 페이지네이션 (라이트/다크 공용)
----------------------------------------------- */
.pg_wrap {
    display: flex;
    justify-content: center;
    margin: 30px 0 10px;
    padding: 0 10px;
}

/* 그누보드 기본 pg_wrap 안 링크 초기화 */
.pg_wrap a,
.pg_wrap strong,
.pg_wrap b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    margin: 0 2px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #444;
    cursor: pointer;
}

/* 현재 페이지 (strong 또는 b 태그로 표시됨) */
.pg_wrap strong,
.pg_wrap b {
    background: #ff4e00 !important;
    color: #ffffff !important;
    border-color: #ff4e00 !important;
    box-shadow: 0 3px 8px rgba(255, 78, 0, 0.35);
}

/* hover */
.pg_wrap a:hover {
    background: #fff3ee;
    color: #ff4e00;
    border-color: #ff4e00;
}

/* 이전/다음 화살표 버튼 */
.pg_wrap a.pg_prev,
.pg_wrap a.pg_next,
.pg_wrap a[href*="page=1"]:first-child,
.pg_wrap a:first-child,
.pg_wrap a:last-child {
    background: #fff;
    color: #ff4e00;
    border-color: #ffcbb8;
}

.pg_wrap a.pg_prev:hover,
.pg_wrap a.pg_next:hover {
    background: #ff4e00;
    color: #fff;
    border-color: #ff4e00;
}

/* 다크모드 페이지네이션 */
[data-bs-theme="dark"] .pg_wrap a,
[data-bs-theme="dark"] .pg_wrap strong,
[data-bs-theme="dark"] .pg_wrap b {
    background: #1e1e1e !important;
    border-color: #333 !important;
    color: #cccccc !important;
}

[data-bs-theme="dark"] .pg_wrap strong,
[data-bs-theme="dark"] .pg_wrap b {
    background: #ff4e00 !important;
    color: #ffffff !important;
    border-color: #ff4e00 !important;
}

[data-bs-theme="dark"] .pg_wrap a:hover {
    background: #2a1a14 !important;
    color: #ff4e00 !important;
    border-color: #ff4e00 !important;
}

/* Bootstrap pagination이 쓰인 경우 대비 */
[data-bs-theme="dark"] .pagination .page-link {
    background-color: #1a1a1a !important;
    border-color: #333 !important;
    color: #cccccc !important;
}

[data-bs-theme="dark"] .pagination .page-link:hover {
    background-color: #2a1a14 !important;
    border-color: #ff4e00 !important;
    color: #ff4e00 !important;
}

[data-bs-theme="dark"] .pagination .active .page-link {
    background-color: #ff4e00 !important;
    border-color: #ff4e00 !important;
    color: #ffffff !important;
}

/* 라이트 Bootstrap pagination */
.pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    border-color: #e0e0e0;
    color: #444;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
}

.pagination .page-link:hover {
    background: #fff3ee;
    border-color: #ff4e00;
    color: #ff4e00;
}

.pagination .active .page-link {
    background-color: #ff4e00 !important;
    border-color: #ff4e00 !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(255, 78, 0, 0.35);
}

/* 모바일 페이지네이션 */
@media (max-width: 768px) {
    .pg_wrap a,
    .pg_wrap strong,
    .pg_wrap b {
        min-width: 32px;
        height: 32px;
        font-size: 0.82rem;
        margin: 0 1px;
        border-radius: 6px;
    }
}


/* -----------------------------------------------
   11. 반응형 (모바일 768px 이하)
----------------------------------------------- */
@media (max-width: 768px) {
    /* ── 뷰 페이지 ── */

    /* 카드 테두리/여백 제거 */
    article#bo_v {
        margin: 0 !important;
        padding: 0 !important;           /* 전체 패딩 0으로 통일 */
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow-x: hidden !important;
    }

    /* 텍스트 요소들: 카드 안쪽 여백을 CSS로 일괄 부여 */
    #bo_v_title,
    .bo_v_info,
    #bo_v_con,
    #bo_v_act,
    .bo_v_com,
    .video-source,
    .video-source-box,
    .v-nav {
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }

    #bo_v_title {
        font-size: 1.35rem !important;
        line-height: 1.4;
        padding-top: 18px !important;
    }

    .bo_v_info {
        gap: 10px;
        font-size: 0.8rem;
    }

    #bo_v_con { font-size: 1rem; }

    .bo_v_com {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        margin: 20px 0 !important;
        gap: 6px;
    }

    .v-nav { margin: 20px 0; }

    /* 댓글 영역 */
    #bo_vc {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 영상: 화면 꽉 채우기 */
    .video-wrapper:not(.shorts) {
        width: 100vw !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }

    .video-wrapper.shorts {
        width: 85% !important;
        left: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        transform: none !important;
    }

    /* ── 리스트 페이지 ── */
    .container.full-mobile {
        padding-left: 8px !important;
        padding-right: 8px !important;
        overflow-x: hidden;
    }

    /* 모바일 2열 그리드 */
    .row.g-mobile-0 {
        --bs-gutter-x: 8px !important;
        --bs-gutter-y: 8px !important;
    }

    .row.g-mobile-0 > .col-12 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .video-card {
        border-radius: 10px !important;
        border: 1px solid var(--card-border) !important;
        margin-bottom: 0;
    }

    .video-title {
        font-size: 12px;
        height: auto;
        max-height: 36px;
        -webkit-line-clamp: 2;
    }

    .video-info { padding: 8px 10px; }

    .video-hit-badge { font-size: 10px; padding: 2px 6px; }
}
/* 비디오 메타 (작성자/날짜) */
.video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.video-author {
    font-size: 11px;
    color: #888;
    font-weight: 600;
}
.video-date {
    font-size: 11px;
    color: #aaa;
}


@media (max-width: 768px) {
    article#bo_v,
    article#bo_v #bo_v_atc,
    article#bo_v section {
        overflow: visible !important;
        overflow-x: visible !important;
    }
}
