/* 기본 스타일 */
body {
    font-family: 'Helvetica Neue', sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

main {
    width: 100%;
    max-width: 1600px; /* 전체 컨테이너 폭 확장 */
    text-align: center;
}

h1 {
    font-size: 3em;
    color: #2c3e50;
}

/* ==================================
   새로운 제어판 (Control Panel) 스타일
   ================================== */

/* 패널 기본 구조 */
.control-panel, .filter-panel {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
    text-align: left; /* 패널 내부 정렬은 왼쪽으로 */
}

.search-mode {
    margin-bottom: 15px;
}
.search-mode label {
    margin-right: 15px;
    cursor: pointer;
}

.search-main {
    display: flex;
    gap: 10px;
}

#searchInput {
    flex-grow: 1; /* 검색창이 남은 공간을 모두 차지하도록 */
    padding: 12px 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 6px;
}

/* 버튼 스타일 */
.btn-primary {
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap; /* 버튼 글자 줄바꿈 방지 */
}
.btn-primary:hover {
    background-color: #2980b9;
}

.search-actions {
    margin-top: 15px;
}
.search-actions button {
    background-color: #ecf0f1;
    color: #34495e;
    border: 1px solid #bdc3c7;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 0.9em;
}
.search-actions button:hover {
    background-color: #dfe6e9;
}

/* ==================================
   상세 필터 (Filter Panel) 스타일
   ================================== */
.filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 반응형 그리드 */
    gap: 20px;
}

.filter-group h4 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.filter-group input[type="number"],
.filter-group select {
    width: 100px;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 5px;
}

.filter-group input[type="checkbox"] {
    margin-right: 5px;
}


/* ==================================
   결과 테이블 (Results Table) 컨테이너
   ================================== */
.results-table-container {
    width: 100%;
    overflow-x: auto; /* 테이블이 화면보다 크면 가로 스크롤 생성 */
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.results-table {
    width: 100%;
    border-collapse: collapse; /* 테이블 테두리 한 줄로 합치기 */
    font-size: 0.9em;
}

.results-table thead tr {
    background-color: #f8f9fa; /* 헤더 배경색 */
    color: #34495e;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.results-table th,
.results-table td {
    padding: 10px 10px; /* 여백을 줄임 */
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle; /* 내용물 세로 중앙 정렬 */
    white-space: nowrap; /* 내용 줄바꿈 방지 */
    text-align: left; /* <<<=== 모든 데이터 셀을 왼쪽 정렬하는 이 줄을 추가! */
}
}

.results-table tbody tr:last-child td {
    border-bottom: none; /* 마지막 줄 테두리 제거 */
}

.results-table tbody tr:hover {
    background-color: #f9f9f9; /* 마우스 올렸을 때 배경색 */
}

.table-thumbnail {
    width: 120px; /* 썸네일 크기 키움 */
    border-radius: 4px;
}

.results-table .title {
    font-weight: 600;
    color: #000;
    white-space: normal; /* 제목은 줄바꿈 허용 */
    min-width: 250px; /* 최소 너비 지정 */
}
.results-table .channel {
    font-size: 0.9em;
    color: #555;
}

/* 우리 서비스의 핵심 지표 강조 스타일 */
.highlight-metric {
    font-weight: bold;
    font-size: 1.1em;
}
.highlight-metric.vph {
    color: #27ae60; /* VPH 색상 */
}
.highlight-metric.ratio {
    color: #e74c3c; /* 비율 색상 */
}

/* 링크 버튼 스타일 */
.btn-link {
    display: inline-block;
    padding: 5px 12px;
    background-color: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.btn-link:hover {
    background-color: #dfe6e9;
}
/* ==================================
   정렬 가능한 테이블 헤더 스타일
   ================================== */

th.sortable {
    cursor: pointer;
    user-select: none; /* 텍스트 선택 방지 */
}

th.sortable:hover {
    background-color: #f0f3f5;
}

th.sortable span {
    font-size: 0.8em;
    margin-left: 4px;
    color: #3498db; /* 정렬 화살표 색상 */
}
/* ==================================
   순번 및 썸네일 다운로드 스타일
   ================================== */

/* 순번(#) 열 스타일 */
.col-number {
    font-weight: bold;
    color: #7f8c8d;
    text-align: center;
    width: 20px; /* 최소 너비 */
}

/* 썸네일 셀 스타일 */
.thumbnail-cell {
    position: relative; /* 다운로드 링크를 띄우기 위한 기준점 */
    text-align: center;
}

/* 썸네일 다운로드 링크 스타일 */
.download-link {
    position: absolute;
    bottom: 12px; /* td의 padding 값만큼 띄움 */
    right: 15px; /* td의 padding 값만큼 띄움 */
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    opacity: 0; /* 평소엔 숨김 */
    transition: opacity 0.2s;
    text-decoration: none;
}

/* 썸네일에 마우스 올렸을 때 다운로드 링크 표시 */
.thumbnail-cell:hover .download-link {
    opacity: 1;
}
/* ==================================
   좋아요 비율 스타일 추가
   ================================== */

.highlight-metric.like-ratio {
    color: #3498db; /* 좋아요 비율 색상 (파란색 계열) */
}