/* Vertical Portfolio Frontend Styles */

/* 기본 레이아웃 */
.vp-portfolio-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.vp-portfolio-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .vp-portfolio-container {
        grid-template-columns: 1fr 300px;
    }
    
    .vp-portfolio-items {
        order: 1;
    }
    
    .vp-sidebar {
        order: 2;
    }
}

/* 모바일 헤더 */
.vp-mobile-header {
    display: flex;
    gap: 15px;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (min-width: 768px) {
    .vp-mobile-header {
        display: none;
    }
}

/* 검색 입력 */
.vp-search-wrapper {
    position: relative;
    flex: 1;
}

.vp-search-input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.vp-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.5;
    pointer-events: none;
}

/* 필터 토글 버튼 (모바일) */
.vp-filter-toggle-mobile {
    position: relative;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.vp-filter-count {
    position: absolute;
    top: -5px;
    right: -5px;
    /* background는 동적으로 설정됨 */
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* 사이드바 */
.vp-sidebar {
    display: none;
}

@media (min-width: 768px) {
    .vp-sidebar {
        display: block;
    }
    
    .vp-sidebar-sticky {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
}

.vp-sidebar-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.vp-filter-reset {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    /* background는 동적으로 설정됨 */
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.vp-filter-reset:hover {
    /* hover background는 동적으로 설정됨 */
}

.vp-filter-reset svg {
    width: 16px;
    height: 16px;
}

/* 필터 섹션 */
.vp-filter-section {
    border-bottom: 1px dashed #ddd;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.vp-filter-section:last-child {
    border-bottom: none;
}

.vp-filter-title {
    margin: 0;
}

.vp-filter-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
}

.vp-chevron {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.vp-filter-toggle[aria-expanded="false"] .vp-chevron {
    transform: rotate(-90deg);
}

.vp-filter-content {
    padding-top: 10px;
    overflow: hidden;
}

.vp-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vp-filter-button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.vp-filter-button:hover {
    background: #f0f0f0;
}

.vp-filter-button.active {
    /* background와 border-color는 동적으로 설정됨 */
    color: #fff;
}

/* 포트폴리오 카운트 */
.vp-portfolio-count {
    text-align: right;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.vp-count-number {
    font-weight: bold;
    margin-right: 5px;
}

/* 포트폴리오 그리드 */
.vp-masonry-grid {
    display: flex;
    gap: 20px;
}

.vp-masonry-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 포트폴리오 아이템 */
.vp-portfolio-item {
    margin-bottom: 30px;
}

.vp-portfolio-link {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.vp-portfolio-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.vp-portfolio-images {
    display: flex;
    flex-direction: column;
}

.vp-portfolio-images img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    line-height: 0;
}

/* 포트폴리오 제목 */
.vp-portfolio-title {
    margin: 0;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #333;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 로딩 스피너 */
.vp-loading {
    text-align: center;
    padding: 40px;
}

.vp-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    /* border-top-color는 동적으로 설정됨 */
    border-radius: 50%;
    animation: vp-spin 1s linear infinite;
}

@keyframes vp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 모달 */
.vp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vp-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.vp-modal-content {
    background: #fff;
    border-radius: 8px;
    max-height: 96vh;
    width: 95%;
    max-width: 1280px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.vp-modal-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

.vp-modal-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.vp-modal-body {
    overflow-y: auto;
}

.vp-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .vp-modal-grid {
        grid-template-columns: 250px 1fr;
    }
}

/* 모달 사이드바 */
.vp-modal-sidebar {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.vp-modal-info {
    font-size: 14px;
}

.vp-info-list {
    margin: 0;
}

.vp-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.vp-info-item:last-child {
    border-bottom: none;
}

.vp-info-item dt {
    color: #666;
}

.vp-info-item dd {
    font-weight: bold;
    margin: 0;
}

/* 모달 메인 콘텐츠 */
.vp-modal-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.vp-modal-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vp-modal-images img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 이미지 그룹 */
.vp-image-group {
    position: relative;
    margin-bottom: 30px;
}

.vp-image-group-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f0f0f0;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 14px;
}

.vp-image-group-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vp-modal-description {
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    line-height: 1.6;
}

/* 스펙 섹션 */
.vp-specs-section {
    margin-top: 30px;
}

.vp-specs-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.vp-specs-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
}

.vp-specs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vp-spec-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.vp-spec-item:last-child {
    border-bottom: none;
}

.vp-spec-label {
    color: #666;
}

.vp-spec-value {
    font-weight: 500;
}

/* 모달 닫기 버튼 */
.vp-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.vp-modal-close:hover {
    background: rgba(0,0,0,0.2);
}

.vp-modal-close svg {
    width: 18px;
    height: 18px;
}

/* 스크롤바 숨김 */
.vp-sidebar-sticky::-webkit-scrollbar {
    display: none;
}

.vp-sidebar-sticky {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 화면 리더 전용 텍스트 */
.screen-reader-text {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
