/* gallery/list.css */

/* 충돌을 피하기 위해 더 구체적인 선택자 사용 */
.board-wrapper .board-container.gallery-container {
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 30px;
    width: 100%;
}

/* 검색 영역 스타일 */
.board-wrapper .gallery-search-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 30px;
}

.board-wrapper .gallery-actions {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.board-wrapper .gallery-view-switch {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.board-wrapper .view-switch-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    color: var(--text-sub2);
}

.board-wrapper .view-switch-btn.active {
    background-color: #f5f5f5;
    color: var(--main-color);
}

.board-wrapper .view-switch-btn:hover {
    background-color: #f0f0f0;
    color: var(--main-color);
}

/* 검색 컨테이너 스타일 */
.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-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
}

.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 .btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.board-wrapper .w-100 {
    width: 100% !important;
}

.board-wrapper .mt-2 {
    margin-top: 0.5rem !important;
}

.board-wrapper .align-self-end {
    align-self: flex-end !important;
}

/* 그리드 뷰 스타일 */
.board-wrapper .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.board-wrapper .gallery-card {
    background-color: white;
    border-radius: 8px;
    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 .gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.board-wrapper .gallery-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 .gallery-new-badge::after {
    content: "NEW";
    color: white;
}

.board-wrapper .gallery-card-img {
    height: 180px;
    overflow: hidden;
}

.board-wrapper .gallery-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.board-wrapper .gallery-card:hover .gallery-card-img img {
    transform: scale(1.05);
}

.board-wrapper .gallery-card-info {
    padding: 15px;
}

.board-wrapper .gallery-card-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-wrapper .gallery-card-title a {
    color: var(--text-main);
    text-decoration: none;
}

.board-wrapper .gallery-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-sub2);
}

.board-wrapper .gallery-card-date {
    color: var(--text-sub2);
}

.board-wrapper .gallery-card-views {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-sub2);
}

/* 리스트 뷰 스타일 */
.board-wrapper .gallery-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.board-wrapper .gallery-list-item {
    display: flex;
    gap: 20px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 15px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.board-wrapper .gallery-list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.board-wrapper .gallery-list-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 .gallery-list-thumb {
    flex: 0 0 120px;
    height: 90px;
    overflow: hidden;
    border-radius: 4px;
}

.board-wrapper .gallery-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.board-wrapper .gallery-list-item:hover .gallery-list-thumb img {
    transform: scale(1.05);
}

.board-wrapper .gallery-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.board-wrapper .gallery-list-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-main);
}

.board-wrapper .gallery-list-title a {
    color: var(--text-main);
    text-decoration: none;
}

.board-wrapper .gallery-list-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-sub2);
}

.board-wrapper .gallery-list-date,
.board-wrapper .gallery-list-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 페이지네이션 및 업로드 버튼 영역 */
.board-wrapper .gallery-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 .gallery-upload-actions {
    position: absolute;
    right: 0;
}

.board-wrapper .gallery-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.board-wrapper .gallery-upload-btn:hover {
    background-color: var(--sub-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 127, 42, 0.3);
}

/* 갤러리 비어있을 때 스타일 */
.board-wrapper .gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-sub2);
}

.board-wrapper .gallery-empty p {
    margin: 0;
    font-size: 16px;
}

.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 #dateSearchField {
    display: flex;
    align-items: center;
    flex: 1;
}

.board-wrapper .date-input {
    flex: 1;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
}

.board-wrapper .date-separator {
    margin: 0 10px;
    color: #666;
}

/* 날짜 입력 필드 캘린더 아이콘 커스텀 */
.board-wrapper .date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    filter: invert(0.5);
}

.board-wrapper .date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 반응형 스타일 */
@media (max-width: 1024px) {
    .board-wrapper .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .board-wrapper .form-row {
        flex-direction: column;
    }

    .board-wrapper .col-md-2,
    .board-wrapper .col-md-3,
    .board-wrapper .col-md-5,
    .board-wrapper .col-md-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .board-wrapper .gallery-container {
        padding: 20px 15px;
    }

    .board-wrapper .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }

    .board-wrapper .gallery-search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .board-wrapper .gallery-pagination-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .board-wrapper .gallery-upload-actions {
        position: static;
        margin-top: 20px;
        width: 100%;
    }

    .board-wrapper .gallery-upload-btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .board-wrapper .gallery-list-item {
        flex-direction: column;
    }

    .board-wrapper .gallery-list-thumb {
        width: 100%;
        height: 150px;
        flex: none;
    }
}