/* video/list.css */

/* 검색 영역 스타일 */
.board-wrapper .video-search-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 30px;
}

/* 검색 컨테이너 스타일 */
.board-wrapper .search-container {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.board-wrapper .search-form {
    width: 100%;
}

.board-wrapper .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -5px;
    margin-left: -5px;
}

.board-wrapper .form-group {
    padding-right: 5px;
    padding-left: 5px;
    margin-bottom: 15px;
}

.board-wrapper .col-md-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

.board-wrapper .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.board-wrapper .col-md-7 {
    flex: 0 0 58.333333%;
    max-width: 58.333333%;
}

.board-wrapper .form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.board-wrapper .btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.board-wrapper .btn-primary {
    color: #fff;
    background-color: var(--main-color);
    border-color: var(--main-color);
}

.board-wrapper .w-100 {
    width: 100% !important;
}

/* 비디오 그리드 뷰 스타일 */
.board-wrapper .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.board-wrapper .video-card {
    background-color: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
}

.board-wrapper .video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.board-wrapper .video-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #FF5722;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 2;
}

.board-wrapper .video-new-badge::after {
    content: "NEW";
    color: white;
}

.board-wrapper .post-status {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 5;
    font-weight: 500;
}

/* 비디오 썸네일 영역 */
.board-wrapper .video-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 비율 */
    overflow: hidden;
    background-color: #000;
}

.board-wrapper .video-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s, opacity 0.3s;
}

.board-wrapper .video-card:hover .video-card-thumbnail img {
    transform: scale(1.05);
    opacity: 0.8;
}

/* 재생 버튼 오버레이 */
.board-wrapper .video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(0, 0, 0, 0.3);
}

.board-wrapper .video-card:hover .video-play-overlay {
    opacity: 1;
}

.board-wrapper .video-play-button {
    width: 68px;
    height: 48px;
    background-color: #ff0000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.board-wrapper .video-play-button svg {
    width: 24px;
    height: 24px;
    color: white;
    margin-left: 2px;
}

.board-wrapper .video-card:hover .video-play-button {
    transform: scale(1.1);
    background-color: #cc0000;
}

/* 조회수 표시 */
.board-wrapper .video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 비디오 정보 영역 */
.board-wrapper .video-card-info {
    padding: 16px;
}

.board-wrapper .video-card-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 42px;
}

.board-wrapper .video-card-title a {
    color: var(--text-main);
    text-decoration: none;
}

.board-wrapper .video-card-title a:hover {
    color: var(--main-color);
}

.board-wrapper .video-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-sub2);
}

.board-wrapper .video-card-date {
    color: var(--text-sub2);
}

/* 비디오 목록이 비어있을 때 */
.board-wrapper .video-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--text-sub2);
    background-color: #f8f9fa;
    border-radius: 8px;
}

.board-wrapper .video-empty p {
    margin: 0;
    font-size: 16px;
}

/* 페이지네이션 및 업로드 버튼 영역 */
.board-wrapper .video-pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 30px;
}

.board-wrapper .pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.board-wrapper .pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.board-wrapper .page-item {
    margin: 0 5px;
    width: auto;
    height: auto;
}

.board-wrapper .page-link {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: all 0.3s ease;
}

.board-wrapper .page-item.active .page-link {
    background-color: var(--main-color);
    color: white;
    border-color: var(--main-color);
}

.board-wrapper .page-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

/* 업로드 버튼 */
.board-wrapper .video-upload-actions {
    position: absolute;
    right: 0;
}

.board-wrapper .video-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.board-wrapper .video-upload-btn:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* 비디오 모달 스타일 */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

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

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s;
}

.video-modal-close:hover {
    transform: scale(1.2);
}

.video-modal-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 비율 */
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

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

/* 반응형 스타일 */
@media (max-width: 1024px) {
    .board-wrapper .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .board-wrapper .form-row {
        flex-direction: column;
    }

    .board-wrapper .col-md-2,
    .board-wrapper .col-md-3,
    .board-wrapper .col-md-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .board-wrapper .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }

    .board-wrapper .video-pagination-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .board-wrapper .video-upload-actions {
        position: static;
        margin-top: 20px;
        width: 100%;
    }

    .board-wrapper .video-upload-btn {
        width: 100%;
    }

    .video-modal-content {
        width: 95%;
    }

    .video-modal-close {
        top: -35px;
        font-size: 28px;
    }
}

@media (max-width: 576px) {
    .board-wrapper .video-card-title {
        font-size: 14px;
        min-height: auto;
    }

    .board-wrapper .video-card-info {
        padding: 12px;
    }

    .board-wrapper .video-play-button {
        width: 56px;
        height: 40px;
    }

    .board-wrapper .video-play-button svg {
        width: 20px;
        height: 20px;
    }
}
