* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #222222;
    line-height: 1.43;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #222222;
}

.header p {
    font-size: 1.1rem;
    color: #717171;
    font-weight: 400;
}

.search-filter-section {
    background: #ffffff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* 검색창 돋보기 아이콘 왼쪽 고정 */
.search-box {
    position: relative;
    margin-bottom: 30px;
    justify-content: center;
    align-items: center;
    display: flex;
}

.search-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-250px) translateY(-50%);
    color: #b0b0b0;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 2;
    top: 50%;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 16px 24px 16px 44px;
    font-size: 16px;
    border: none;
    border-bottom: 2px solid #b0b0b0;
    border-radius: 0;
    background: transparent;
    transition: border-color 0.2s ease;
    font-family: inherit;
    display: inline-block;
    box-shadow: none;
    line-height: normal;
}

.search-input:focus {
    outline: none;
    border-bottom: 2.5px solid #222222;
    box-shadow: none;
}
.search-input:focus ~ .search-icon,
.search-box:focus-within .search-icon {
    color: #222222;
}

.search-input::placeholder {
    color: #b0b0b0;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    justify-content: center;
}

.filter-group {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    display: flex;
    justify-content: flex-start;
}

.subcategory-container {
    min-height: 60px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
}

.filter-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 14px;
    border: 1px solid #ebebeb;
    background: white;
    user-select: none;
    position: relative;
}

/* Main category colors */
.filter-option[data-category="travel-info"] {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.filter-option[data-category="planning"] {
    background: #fff5f5;
    border-color: #fed7d7;
}

.filter-option[data-category="booking"] {
    background: #f0fff4;
    border-color: #c6f6d5;
}

.filter-option[data-category="accommodation"] {
    background: #fffbeb;
    border-color: #fef5e7;
}

.filter-option[data-category="transportation"] {
    background: #fff7ed;
    border-color: #fed7aa;
}

.filter-option[data-category="food"] {
    background: #f0f9ff;
    border-color: #bfdbfe;
}

.filter-option[data-category="others"] {
    background: #faf5ff;
    border-color: #e9d5ff;
}

.filter-option:hover {
    border-color: #222222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.filter-option input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1);
    accent-color: #222222;
    display: none;
}

.filter-option label {
    cursor: pointer;
    font-weight: 500;
    color: #717171;
    transition: color 0.2s ease;
}

.filter-option input[type="checkbox"]:checked + label {
    color: #222222;
    font-weight: 600;
}

.filter-option.checked {
    background: #222222;
    border-color: #222222;
    color: white;
}

.filter-option.checked label {
    color: white;
}

/* :has() 선택자 대체 */
.filter-option input[type="checkbox"]:checked ~ label {
    color: white;
}

/* 서브카테고리 필터 스타일 */
.subcategory-filter .filter-option {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
}

.subcategory-filter .filter-option:hover {
    border-color: #717171;
    background: #f0f0f0;
}

.subcategory-filter .filter-option.checked {
    background: #717171;
    border-color: #717171;
}

.subcategory-filter .filter-option label {
    font-weight: 400;
    color: #666666;
}

.subcategory-filter .filter-option.checked label {
    color: white;
}

.reset-filters {
    background: transparent;
    color: #717171;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-top: 8px;
    font-family: inherit;
}

.reset-filters:hover {
    background: #f7f7f7;
    border-color: #c0c0c0;
    color: #222222;
}

.results-count {
    text-align: left;
    margin: 0 0 24px 0;
    font-size: 1rem;
    color: #222222;
    font-weight: 500;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 0;
    align-items: stretch;
}

.resource-card {
    background: white;
    border-radius: 12px;
    padding: 0;
    border: 1px solid #ebebeb;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.card-header {
    padding: 16px 16px 0 16px;
    position: relative;
}
.featured-star {
    position: absolute;
    top: 10px;
    right: 16px;
    color: #ffe066;
    font-size: 1.3rem;
    opacity: 0.7;
    z-index: 2;
}
.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222222;
    margin-bottom: 8px;
    line-height: 1.2;
}
.card-category {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 8px;
}
.card-category[data-category="travel-info"] {
    background: #f8f9fa;
    color: #717171;
    border: 1px solid #e9ecef;
}
.card-category[data-category="planning"] {
    background: #fff5f5;
    color: #717171;
    border: 1px solid #fed7d7;
}
.card-category[data-category="booking"] {
    background: #f0fff4;
    color: #717171;
    border: 1px solid #c6f6d5;
}
.card-category[data-category="accommodation"] {
    background: #fffbeb;
    color: #717171;
    border: 1px solid #fef5e7;
}
.card-category[data-category="transportation"] {
    background: #fff7ed;
    color: #717171;
    border: 1px solid #fed7aa;
}
.card-category[data-category="food"] {
    background: #f0f9ff;
    color: #717171;
    border: 1px solid #bfdbfe;
}
.card-category[data-category="others"] {
    background: #faf5ff;
    color: #717171;
    border: 1px solid #e9d5ff;
}
.card-subcategory {
    color: #999999;
    font-size: 0.85rem;
    margin-bottom: 12px;
    font-weight: 500;
}
.card-description {
    color: #717171;
    line-height: 1.5;
    margin-bottom: 16px;
    font-size: 0.875rem;
    padding: 0 16px;
}
.card-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    padding: 0 16px;
    min-height: 20px;
}
.keyword-tag {
    background: #f7f7f7;
    color: #999999;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 400;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 16px 16px;
    margin-top: auto;
}
.visit-button {
    background: transparent;
    color: #717171;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 70px;
    text-align: center;
    border: 1px solid #e0e0e0;
}
.visit-button:hover {
    background: #222222;
    color: white;
    border-color: #222222;
    transform: translateY(-1px);
}
.card-icon {
    font-size: 1rem;
    color: #cccccc;
}

/* 라이트박스 스타일 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: calc(90% - 40px);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border: 1px solid #ebebeb;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #333;
}

.lightbox-header {
    margin-bottom: 30px;
}

.lightbox-category {
    background: #f7f7f7;
    color: #222222;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* 라이트박스 카테고리 색상 */
.lightbox-category[data-category="travel-info"] {
    background: #f8f9fa;
    color: #717171;
    border: 1px solid #e9ecef;
}

.lightbox-category[data-category="planning"] {
    background: #fff5f5;
    color: #717171;
    border: 1px solid #fed7d7;
}

.lightbox-category[data-category="booking"] {
    background: #f0fff4;
    color: #717171;
    border: 1px solid #c6f6d5;
}

.lightbox-category[data-category="accommodation"] {
    background: #fffbeb;
    color: #717171;
    border: 1px solid #fef5e7;
}

.lightbox-category[data-category="transportation"] {
    background: #fff7ed;
    color: #717171;
    border: 1px solid #fed7aa;
}

.lightbox-category[data-category="food"] {
    background: #f0f9ff;
    color: #717171;
    border: 1px solid #bfdbfe;
}

.lightbox-category[data-category="others"] {
    background: #faf5ff;
    color: #717171;
    border: 1px solid #e9d5ff;
}

.lightbox-title {
    font-size: 1.75rem;
    color: #222222;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.2;
}

.lightbox-subcategory {
    color: #999999;
    font-size: 1rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.lightbox-info {
    margin-bottom: 20px;
}

.lightbox-info p {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #717171;
}

.lightbox-info h4 {
    color: #222222;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.lightbox-website {
    background: #222222;
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-block;
    margin-top: 20px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    float: right;
    outline: 2px solid #222222;
}

/* 라이트박스 네비게이션 화살표 */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    padding: 20px;
    z-index: 1001;
}

.lightbox-nav:hover {
    color: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.2);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.8);
}

.lightbox-nav:disabled:hover {
    color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(0.8);
}

/* 라이트박스 애니메이션 */
.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border: 1px solid #ebebeb;
    transition: all 0.3s ease;
}

.lightbox-content.slide-left {
    animation: slideLeft 0.3s ease-out;
}

.lightbox-content.slide-right {
    animation: slideRight 0.3s ease-out;
}

@keyframes slideLeft {
    0% {
        transform: translate(-50%, -50%) translateX(-50px);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) translateX(0);
        opacity: 1;
    }
}

@keyframes slideRight {
    0% {
        transform: translate(-50%, -50%) translateX(50px);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) translateX(0);
        opacity: 1;
    }
}

.lightbox-website:hover {
    background: transparent;
    color: #222222;
    transform: translateY(-1px);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .directory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .lightbox-content {
        padding: 20px;
        width: calc(100% - 60px);
        max-width: none;
    }
    
    /* 모바일에서 화살표 버튼 크기 증가 */
    .lightbox-nav {
        font-size: 40px;
        padding: 30px;
    }
    
    .lightbox-nav.prev {
        left: 10px;
    }
    
    .lightbox-nav.next {
        right: 10px;
    }
    
    /* 모바일에서 필터 버튼 크기 증가 */
    .filter-option {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
    }
    
    /* 모바일에서 서브카테고리 필터 알약 형태 유지 */
    .subcategory-filter .filter-option {
        padding: 8px 14px;
        font-size: 14px;
        border-radius: 20px;
        min-height: 40px;
    }
    
    /* 모바일에서 reset 버튼 크기 증가 */
    .reset-filters {
        padding: 12px 16px;
        font-size: 16px;
        min-height: 44px;
    }
    
    /* 모바일에서 서브카테고리 컨테이너 높이 조정 */
    .subcategory-container {
        min-height: 80px;
        padding: 15px 0;
        justify-content: center;
        align-items: flex-start;
    }
    
    /* 모바일에서 서브카테고리 필터 옵션 정렬 개선 */
    .subcategory-filter .filter-options {
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    /* 모바일에서 검색창 크기 증가 */
    .search-input {
        max-width: 300px;
        width: 80%;
        padding: 18px 24px 18px 50px;
        font-size: 18px;
        min-height: 44px;
    }
    
    /* 모바일에서 검색 아이콘 위치 조정 */
    .search-icon {
        left: 50%;
        transform: translateX(-150px) translateY(-50%);
        font-size: 1.1rem;
        top: 50%;
    }
}

@media (max-width: 480px) {
    .lightbox-nav {
        font-size: 36px;
        padding: 20px;
    }
    
    .lightbox-nav.prev {
        left: 5px;
    }
    
    .lightbox-nav.next {
        right: 5px;
    }
    
    .lightbox-content {
        padding: 15px;
        width: calc(100% - 40px);
        max-width: none;
    }
    
    /* 작은 모바일에서 서브카테고리 필터 알약 형태 유지 */
    .subcategory-filter .filter-option {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 18px;
        min-height: 36px;
    }
    
    /* 작은 모바일에서 서브카테고리 컨테이너 정렬 개선 */
    .subcategory-container {
        justify-content: center;
        align-items: flex-start;
        min-height: 70px;
    }
    
    /* 작은 모바일에서 서브카테고리 필터 옵션 정렬 개선 */
    .subcategory-filter .filter-options {
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    /* 작은 모바일에서 reset 버튼 크기 조정 */
    .reset-filters {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 40px;
    }
    
    .directory-grid {
        grid-template-columns: 1fr;
    }

    /* 작은 모바일에서 검색창 조정 */
    .search-input {
        max-width: 280px;
        width: 85%;
        padding: 16px 20px 16px 45px;
        font-size: 16px;
        min-height: 40px;
    }
    
    /* 작은 모바일에서 검색 아이콘 위치 조정 */
    .search-icon {
        left: 50%;
        transform: translateX(-140px) translateY(-50%);
        font-size: 1rem;
        top: 50%;
    }
}

/* 로딩 애니메이션 */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: white;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 서브카테고리 중앙정렬 강제 */
.subcategory-container,
.subcategory-filter .filter-options {
    width: 100% !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}