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

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 0.5rem;
    text-align: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/header-bg.jpg');
    background-size: cover;
    background-position: center 30%;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    gap: 2rem;
}

nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    opacity: 1;
    transform: none;
    animation: none;
    margin-top: 3rem;
}

.video-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.video-card h3 {
    padding: 1rem;
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    min-height: 4rem;
    height: auto;
    max-height: 4.5rem;
}

.video-tags {
    padding: 0.5rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.video-tags span {
    background: #f0f0f0;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #2c3e50;
    display: inline-flex;
    align-items: center;
    height: 24px;
    line-height: 1;
    white-space: nowrap;
}

/* 태그 카테고리별 색상 */
.video-tags span[data-category="난이도"] {
    background-color: #4CAF50;
    color: white;
}

.video-tags span[data-category="에디션"] {
    background-color: #2196F3;
    color: white;
}

.video-tags span[data-category="시리즈"] {
    background-color: #673AB7;
    color: white;
}

.video-tags span[data-category="주제"] {
    background-color: #E91E63;
    color: white;
}

.video-tags span[data-category="공유"] {
    background-color: #FFC107;
    color: #2c3e50;
}

.video-tags span[data-category="가이드"] {
    background-color: #9E9E9E;
    color: white;
}

.video-tags span[data-category="길이"] {
    background-color: #795548;
    color: white;
}

.video-card .button-group {
    display: flex;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.watch-btn {
    flex: 1;
    padding: 1rem;
    background-color: #f8f9fa;
    color: #2c3e50;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.watch-btn:hover {
    background-color: #e9ecef;
    color: #e74c3c;
}

.watch-btn i {
    margin-right: 0.5rem;
    color: #e74c3c;
    transition: color 0.3s ease;
}

.watch-btn:hover i {
    color: #c0392b;
}

.share-btn {
    padding: 1rem;
    background-color: #f8f9fa;
    color: #2c3e50;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
}

.share-btn:hover {
    background-color: #e9ecef;
    color: #3498db;
}

.share-btn i {
    font-size: 1.1rem;
}

/* 공유 성공 메시지 스타일 */
.copy-feedback {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2ecc71;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.copy-feedback.show {
    opacity: 1;
}

.header-content {
    padding: 0.5rem 0;
}

.header-content h1 {
    display: none;
}

.channel-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.channel-description {
    display: none;
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
}

/* 태그 필터 스타일 */
.tag-filter {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 2rem;
}

.filter-label {
    color: #2c3e50;
    font-weight: 600;
    margin-right: 1rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.filter-label:hover {
    color: #3498db;
}

.filter-row {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.tag-btn {
    background: #f0f0f0;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-btn:hover {
    background: #e0e0e0;
}

.tag-btn.active {
    background: #3498db;
    color: white;
}

/* 태그 색상 구분 */
.tag-btn[data-type="type"] {
    background: #f0f0f0;
}

.tag-btn[data-type="type"].active {
    background: #2ecc71;
}

.tag-btn[data-type="provider"] {
    background: #f0f0f0;
}

.tag-btn[data-type="provider"].active {
    background: #e74c3c;
}

.tag-btn[data-type="topic"] {
    background: #f0f0f0;
}

.tag-btn[data-type="topic"].active {
    background: #9b59b6;
}

/* 태그 제목 색상 */
h3[data-category="유형"] { color: #2196F3 !important; }
h3[data-category="제공자"] { color: #9C27B0 !important; }
h3[data-category="주제"] { color: #E91E63 !important; }

/* 건축물 카드의 태그 스타일 */
.building-tags .tag {
    background-color: #E91E63;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 다운로드 버튼 스타일 */
.download-btn.world {
    background: #4CAF50;
}

.download-btn.world:hover {
    background: #45a049;
}

.download-btn.structure {
    background: #2196F3;
}

.download-btn.structure:hover {
    background: #1976D2;
}

.filter-row h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.1rem;
    width: 120px;
    flex-shrink: 0;
}

/* 태그 제목 상 */
.filter-row[data-category="길이"] h3 { color: #795548; }
.filter-row[data-category="난이도"] h3 { color: #4CAF50; }
.filter-row[data-category="에디션"] h3 { color: #2196F3; }
.filter-row[data-category="시리즈"] h3 { color: #673AB7; }
.filter-row[data-category="주제"] h3 { color: #E91E63; }
.filter-row[data-category="공유"] h3 { color: #FFC107; }
.filter-row[data-category="가이드"] h3 { color: #9E9E9E; }

.search-box {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

#searchInput {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #3498db;
}

/* 채널 소개 페이지 스타일 */
.about-section {
    padding: 2rem;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 2rem;
}

.channel-description-full {
    text-align: center;
}

.channel-description-full h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.intro-text {
    font-size: 1.2rem;
    color: #34495e;
    margin-bottom: 2rem;
}

.about-text {
    text-align: left;
    margin: 2rem 0;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1rem;
}

.email-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.email-link:hover {
    text-decoration: underline;
}

.channel-links {
    margin-top: 3rem;
}

.channel-links h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
}

.social-btn.youtube {
    background-color: #ff0000;
    color: white;
}

.social-btn i {
    margin-right: 0.5rem;
}

/* 로고 링크 스타일 */
.logo-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

/* 구독 버튼 스타일 */
.subscribe-btn {
    margin-left: 0;
    transform: scale(0.6);
    transform-origin: center;
}

.subscribe-btn a {
    background-color: #ff0000;
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.subscribe-btn a:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
}

.subscribe-btn i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    nav ul {
        flex-direction: column;
        width: 100%;
    }
    
    .subscribe-btn {
        margin: 0;
        transform: scale(0.8);
    }
}

/* 새로운 featured 카드 스타일 */
.featured-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    padding: 0.5rem 1rem 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
    position: relative;
}

.card-header::after {
    display: none;
}

.card-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.card-header p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.9;
}

/* 재생목록 버튼 스타일 */
.watch-btn.playlist {
    background-color: #a8d1ff;
    color: #2c3e50;
}

.watch-btn.playlist:hover {
    background-color: #8fc1ff;
    color: #2c3e50;
}

/* 애니메이션 수정 */
.video-grid {
    opacity: 1;
    transform: none;
    animation: none;
}

.featured-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* 각 카드별 애니메이션 딜레이 */
.featured-card:nth-child(1) { animation-delay: 0.1s; }
.featured-card:nth-child(2) { animation-delay: 0.2s; }
.featured-card:nth-child(3) { animation-delay: 0.3s; }

/* 애니메이션 효과 */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .featured-section h2::before,
    .featured-section h2::after {
        max-width: 50px;
    }
    
    .featured-section {
        margin: 2rem auto;
    }
}

footer {
    text-align: center;
    padding: 3rem 0;  /* 위아래 여백 증가 */
    margin-top: 3rem; /* 상단 여백 추가 */
    color: #666;
}

footer p {
    font-size: 0.9rem;
}

/* 추천 강좌 카드 스타일 개선 */
.featured-card .video-card {
    box-shadow: none;
    border-radius: 0;
}

.featured-card .video-card:hover {
    transform: none;
}

/* 영상 정보 스타일 */
.video-info {
    background-color: transparent;  /* 경색 제거 */
    padding: 0.5rem;  /* 패딩 줄임 */
    margin-bottom: 0.5rem;  /* 마진 줄임 */
    text-align: right;  /* 오른쪽 정렬 */
}

.video-stats {
    color: #666;  /* 글자색을 회색으로 */
    font-size: 0.85rem;  /* 글자 크기 줄임 */
    margin: 0;
}

.video-stats #totalVideos {
    color: #ff0000;  /* 숫자만 빨간색으로 */
    font-weight: bold;
}

.video-stats #currentDate {
    font-weight: normal;  /* 날짜는 보통 굵기로 */
}

/* 건축물 그리드 스타일 */
.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

/* 건축물 카드 스타일 */
.building-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.building-card:hover {
    transform: translateY(-5px);
}

.building-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.building-card h3 {
    padding: 0.5rem 1rem;
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.building-card p {
    padding: 0 1rem 0.5rem 1rem;
    color: #666;
    font-size: 0.9rem;
    flex-grow: 1;
    margin: 0;
}

.building-tags {
    padding: 0 1rem 0.5rem 1rem;
}

.building-tags .tag {
    background-color: #E91E63;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.building-info {
    padding: 0.5rem 1rem;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* 다운로드 버튼 스타일 */
.download-btn {
    display: block;
    margin: 0;
    padding: 0.8rem;
    color: white;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.download-btn.world {
    background: #4CAF50;
}

.download-btn.world:hover {
    background: #45a049;
}

.download-btn.structure {
    background: #2196F3;
}

.download-btn.structure:hover {
    background: #1976D2;
}

.download-btn i {
    margin-right: 0.5rem;
}

.building-type {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 3D 모델 뷰어 스타일 */
model-viewer {
    width: 100%;
    height: 300px;
    background-color: #f8f9fa;
    --poster-color: transparent;
    margin-bottom: -0.5rem;
}

.model-viewer-container {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: -0.5rem;
}

.model-viewer-container .building-type {
    z-index: 1;
}

/* 이미지/모델 전환 버튼 */
.view-toggle {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 1;
    transition: background 0.3s ease;
}

.view-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

.view-toggle i {
    margin-right: 0.3rem;
}

/* 반응형 조정 */
@media (max-width: 1400px) {
    .buildings-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .buildings-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .building-card img,
    model-viewer,
    .model-viewer-container {
        height: 250px;
    }
}

/* 건축물 태그 색상 */
.building-tags .tag[data-category="world"] {
    background-color: #4CAF50;  /* 초록색 */
    color: white;
}

.building-tags .tag[data-category="structure"] {
    background-color: #E91E63;  /* 빨간색 */
    color: white;
}

.building-tags .tag[data-category="character"] {
    background-color: #673AB7;  /* 보라색 */
    color: white;
}

.building-tags .tag[data-category="default"] {
    background-color: #9E9E9E;  /* 회색 */
    color: white;
}