/* =========================================
   1. 기본 설정 (Variables & Reset)
   ========================================= */
:root {
    /* 통합 컬러: 차분한 블루 (#4D7CE3) */
    --primary: #4D7CE3; 
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --text-color: #333;
    --gray-light: #eee;
    --link-color: #007bff;
    --tag-bg: #f8f9fa; /* 태그 배경색 추가 */
}

body {
    font-family: 'Pretendard';
    background-color: var(--bg);
    margin: 0;
    padding: 20px;
    color: var(--text-color);
    padding-bottom: 80px; /* 하단 푸터/플로팅바 공간 확보 */
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* =========================================
   2. 레이아웃 & 공통 컴포넌트
   ========================================= */
.container {
    margin: 0 auto;
    /* 기본 폭 설정 */
    max-width: 1000px; 
}

/* 페이지별 컨테이너 폭 조절 (상황에 따라 사용) */
.container.main-layout { max-width: 800px; min-height: 80vh; display: flex; flex-direction: column; justify-content: center; margin-top: 40px; }
.container.shop-layout { max-width: 800px; margin-top: 40px;}
.container.word-layout { max-width: 600px; margin-top: 40px;}

/* 구분선 */
.divider { border: 0; border-top: 1px dashed #ddd; margin: 20px 0; }

/* --- 공통 검색창 스타일 --- */
.search-wrapper {
    position: relative;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* input[type="text"] 공통 스타일로 통합 */
input[type="text"] {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 50px;
    outline: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s;
    box-sizing: border-box;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(77, 124, 227, 0.2);
}

/* --- 공통 버튼 스타일 --- */
.btn-reset {
    margin-left: auto; 
    background: #f0f0f0; 
    border: none; 
    padding: 6px 12px;
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 0.8rem; 
    color: #666;
    transition: background 0.2s;
}
.btn-reset:hover { background: #e0e0e0; }

.btn-add {
    margin-top: auto; 
    width: 100%; 
    padding: 10px;
    background-color: #333; 
    color: white; 
    border: none;
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: background-color 0.2s;
}
.btn-add:hover { background-color: var(--primary); }

/* --- 공통 푸터 --- */
.footer {
    position: fixed;       
    bottom: 0;             
    left: 0;
    width: 100%;
    height: 40px;          
    line-height: 40px;    
    text-align: center;
    font-size: 0.8rem;
    color: #aaa;            
    background-color: var(--bg); 
    z-index: 9999;         
}


/* =========================================
   3. 필터 & 태그 & 날짜 (검색 페이지용)
   ========================================= */
.filter-section {
    background: white; 
    padding: 25px; 
    border-radius: 16px;
    margin-bottom: 30px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.filter-group { margin-bottom: 20px; }
.filter-group:last-child { margin-bottom: 0; }

.filter-label {
    font-size: 0.85rem; 
    font-weight: 800; 
    color: #444;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    margin-bottom: 10px; 
    display: block;
}

/* 아코디언 스타일 */
.accordion-container {
    display: flex; 
    flex-direction: column; 
    gap: 10px;
}

.category-item {
    border: 1px solid #eee; 
    border-radius: 8px; 
    overflow: hidden;
}

.category-header {
    background: #fff; 
    padding: 12px 16px; 
    cursor: pointer;
    font-size: 0.95rem; 
    font-weight: 700; 
    color: #555;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    transition: background 0.2s;
}
.category-header:hover { background: #f9f9f9; color: var(--primary); }
.category-header::after {
    content: '▼'; 
    font-size: 0.7rem; 
    color: #999; 
    transition: transform 0.3s;
}
.category-item.active .category-header::after { transform: rotate(180deg); }

.category-content {
    display: none; 
    padding: 15px; 
    background: #fafafa; 
    border-top: 1px solid #eee;
}
.category-item.active .category-content { display: block; }

/* 태그 버튼 */
.tag-container { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-btn {
    padding: 6px 14px; 
    border-radius: 20px; 
    border: 1px solid #e0e0e0;
    background: var(--tag-bg); 
    color: #555; 
    cursor: pointer;
    font-size: 0.85rem; 
    font-weight: 500; 
    transition: all 0.2s;
}
.tag-btn:hover { border-color: var(--primary); color: var(--primary); background: white; }
.tag-btn.active {
    background: var(--primary); 
    color: white; 
    border-color: var(--primary);
    font-weight: 600; 
    box-shadow: 0 2px 6px rgba(77, 124, 227, 0.3);
}

/* Shorts 태그 포인트 */
.tag-btn.shorts-tag { border-color: #ff0000; color: #ff0000; background: #fff0f0; }
.tag-btn.shorts-tag.active { background: #ff0000; color: white; }

/* 날짜 입력 */
.date-container { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

input.date-input {
    width: 150px; 
    padding: 10px 14px; 
    border: 1px solid #ddd;
    border-radius: 8px; 
    font-family: 'Pretendard', sans-serif;
    color: #555;
    outline: none; 
    font-size: 0.95rem; 
    text-align: center;
    background: #fff;
}
input.date-input:focus { border-color: var(--primary); }
.date-separator { color: #999; font-weight: bold; }

/* 검색 결과 정보 */
.result-info {
    display: flex; 
    justify-content: flex-end; 
    margin-bottom: 15px;
    font-weight: 600; 
    color: #555; 
    font-size: 0.95rem;
}
.result-count-num { color: var(--primary); margin-left: 4px; font-weight: 700; }


/* =========================================
   8. 반응형 (Media Queries)
   ========================================= */
@media (max-width: 600px) {
    /* 모바일에서는 그리드를 1열로 변경 */
    .video-grid, .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); 
    }
    .container { padding: 0 10px; }
}