/*
* [모듈명]: 디스커버리 전용 스타일
* [파일명]: discovery.css
* [역할]: 검색, 트렌드 태그, 크리에이터 추천 섹션의 프리미엄 다크 UI를 정의합니다.
*/

@import url('signal.css');

:root {
    --discovery-bg: #000000;
    --search-bg: #111111;
    --tag-bg: #111111;
    --tag-active-bg: #1E3A5F;
    --tag-active-text: #00B0FF;
    --card-bg: #111111;
    --tab-inactive: #8B949E;
    --tab-active: #FFFFFF;
    --tab-border: #222222;
}

.hidden {
    display: none !important;
}

.discovery-page {
    background-color: var(--discovery-bg);
    color: #FFFFFF;
    min-height: 100dvh;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); /* 하단 네비게이션 바 높이 확보 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 상단 영역 */
.discovery-header {
    /* [수석 아키텍트]: 고정 높이를 제거하고 세이프 에어리어에 따라 유연하게 늘어나도록 설계 */
    padding-top: calc(var(--safe-top, 0px) + 12px);
    padding-bottom: 12px;
    padding-left: 16px;
    padding-right: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px; /* 최소 규격 유지 */
    height: auto;
    box-sizing: border-box;
}

.header-left {
    flex-shrink: 0;
    width: 40px; /* 좌우 균형을 위한 고정폭 */
    display: flex;
    justify-content: flex-start;
}

.profile-thumb {
    width: 32px;
    height: 32px;
    background-color: var(--search-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-thumb .material-icons {
    font-size: 20px;
    color: #8B949E;
}

.header-center {
    flex-grow: 1;
}

.header-right {
    flex-shrink: 0;
    width: 40px; /* 좌우 균형을 위한 고정폭 */
    display: flex;
    justify-content: flex-end;
}

.header-btn {
    font-size: 24px;
    color: #FFFFFF;
    cursor: pointer;
}

/* 탭 내비게이션 (홈 섹션 .sector-nav와 스타일 동기화) */
.discovery-tabs {
    display: flex;
    height: 44px; /* 홈 섹션 탭 높이와 일치 */
    padding: 0 20px;
    border-bottom: 1px solid var(--tab-border);
    margin-bottom: 0;
    gap: 24px;
}

.tab-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--tab-inactive);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.tab-item.active {
    color: var(--tab-active);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--tab-active);
}

.tab-item:active {
    opacity: 0.7;
}

/* 검색 바 */
.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background-color: transparent;
    border: 1px solid #30363D;
    border-radius: 100px;
    color: #FFFFFF;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: #8B949E;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8B949E;
    font-size: 18px;
}

/* 트렌드 태그 */
.discovery-section {
    margin-top: 32px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px; /* [수석 아키텍트]: 20px에서 16px로 변경하여 수직 열 정렬 */
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-more {
    font-size: 14px;
    color: var(--tag-active-text);
    font-weight: 600;
    cursor: pointer;
}

.trend-tags-container {
    padding: 0 16px; /* [수석 아키텍트]: 20px에서 16px로 변경하여 수직 열 정렬 */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trend-tag {
    padding: 10px 16px;
    background-color: var(--tag-bg);
    color: #C9D1D9;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.trend-tag.active {
    background-color: var(--tag-active-bg);
    color: var(--tag-active-text);
}

/* 시그널 태그 전용 컨테이너 (가변형 줄바꿈 배치) */
.signal-tags-scroll {
    display: flex;
    flex-wrap: wrap; /* 자동으로 줄바꿈되어 한 화면에 노출 */
    padding: 0 20px;
    gap: 10px; /* 가로 및 세로 간격 */
}

/* 스크롤 관련 스타일 제거 (가변형으로 전환되었으므로 불필요) */
.signal-tags-scroll::-webkit-scrollbar {
    display: none;
}

.signal-tag {
    flex-shrink: 0;
    padding: 8px 16px;
    background-color: var(--tag-bg);
    color: #C9D1D9;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.signal-tag.active {
    background-color: #FFFFFF;
    color: #000000;
    border-color: #FFFFFF;
}

/* 크리에이터 카드 슬라이드 */
.creator-slide-container {
    display: flex;
    overflow-x: auto;
    padding: 0 16px 20px; /* [수석 아키텍트]: 20px에서 16px로 변경하여 아바타 수직 라인 일치 */
    gap: 12px;
    scrollbar-width: none;
}

.creator-slide-container::-webkit-scrollbar {
    display: none;
}

.creator-card {
    min-width: 170px;
    width: 170px;
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-image-wrap {
    aspect-ratio: 1 / 1;
    width: 100%;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 12px;
}

.creator-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-badge {
    background-color: #FF4B4B; /* 요청하신 붉은색 */
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 2px; /* 직사각형 느낌을 위한 미세한 곡률 */
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.creator-tags {
    font-size: 12px;
    color: #8B949E;
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 8px 12px;
}

.action-msg {
    font-size: 12px;
    font-weight: 600;
    color: #8B949E;
}

.creator-price {
    font-size: 13px;
    font-weight: 800;
    color: #FFFFFF;
}
