/* ----------------------------------------------------
   [tests/style.css]
   50종 심리테스트 포털 - PC & 모바일 반응형 디자인 시스템
   ---------------------------------------------------- */

/* Google Fonts 로드 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* HSL 기반 세련된 컬러 토큰 */
    --bg-primary: #0f1016;
    --bg-secondary: #161824;
    --bg-card: #202336;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f3f4f6;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --primary: #ff4a8b;
    --primary-gradient: linear-gradient(135deg, #ff4a8b 0%, #ff8a00 100%);
    --secondary-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    
    /* 기능 컬러 */
    --accent: #10b981;
    --info: #3b82f6;
    --danger: #ef4444;
    
    /* 폰트 지정 */
    --font-base: 'Noto Sans KR', sans-serif;
    --font-eng: 'Outfit', sans-serif;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #f1f5f9;
    --border-color: rgba(0, 0, 0, 0.06);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-shadow: rgba(0, 0, 0, 0.03);
}

/* 기본 리셋 및 전역 스타일 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #08090d;
    color: var(--text-primary);
    font-family: var(--font-base);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

[data-theme="light"]body {
    background-color: #f1f5f9;
}

/* 전체 앱 컨테이너 (반응형 대응: PC에서는 와이드, 모바일은 풀 스크린) */
.app-container {
    width: 100%;
    max-width: 1200px; /* 데스크톱 최대 너비 */
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-primary);
    box-shadow: 0 0 50px var(--glass-shadow);
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 50px;
}

/* 공통 상단 네비게이션 헤더 */
.app-header {
    height: 65px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 16, 22, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

[data-theme="light"] .app-header {
    background: rgba(255, 255, 255, 0.85);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.25rem;
    font-family: var(--font-eng);
    letter-spacing: -0.5px;
}

.app-header .logo i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.45rem;
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.theme-toggle-btn:hover {
    color: var(--primary);
}

/* ----------------------------------------------------
   [1] 대시보드 허브 (index.html) 전용 스타일 (반응형 그리드)
   ---------------------------------------------------- */
.hub-content {
    padding: 35px 30px;
    width: 100%;
}

/* 히어로 웰컴 배너 */
.hero-banner {
    padding: 35px 30px;
    border-radius: 24px;
    background: var(--primary-gradient);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(255, 74, 139, 0.25);
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    filter: blur(30px);
}

.hero-banner h1 {
    font-size: 1.85rem;
    font-weight: 950;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 10px;
}

.hero-banner p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    max-width: 700px;
}

/* 검색 필터 바 */
.search-wrapper {
    position: relative;
    margin-bottom: 25px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-base);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 74, 139, 0.18);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.15rem;
}

/* 카테고리 알약 탭 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab-pill {
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s;
}

.tab-pill.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
}

/* 반응형 그리드 시스템 (모바일 1열 -> 태블릿 2열 -> PC 3열 -> 대형화면 4열) */
.test-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
}

@media (min-width: 650px) {
    .test-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 950px) {
    .test-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .test-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.test-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    cursor: pointer;
    position: relative;
    height: 100%;
}

.test-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 74, 139, 0.4);
    box-shadow: 0 12px 28px var(--glass-shadow);
}

.card-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 16px;
}

.card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.35;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.45;
    flex-grow: 1;
}

.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.card-tag {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-family: var(--font-eng);
    font-weight: 600;
}

.card-tag.time {
    color: #ffb800;
    background-color: rgba(255, 184, 0, 0.08);
}

.card-tag.count {
    color: #10b981;
    background-color: rgba(16, 185, 129, 0.08);
}

.card-arrow {
    position: absolute;
    right: 20px;
    top: 24px;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: transform 0.2s, color 0.2s;
}

.test-card:hover .card-arrow {
    transform: translateX(2px);
    color: var(--primary);
}

/* 검색결과 없음 안내 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    width: 100%;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

/* ----------------------------------------------------
   [2] 심리테스트 플레이어 영역 (PC 가독성 보정: 최대 760px 제어)
   ---------------------------------------------------- */
.test-section {
    display: none;
    flex-direction: column;
    padding: 40px 30px;
    flex-grow: 1;
    width: 100%;
    max-width: 760px; /* 텍스트 가독성을 위해 넓이를 좁혀서 중앙 집중형 배치 */
    margin: 0 auto;
}

.test-section.active {
    display: flex;
    animation: fadeIn 0.4s ease-out;
}

/* --- A. 인트로 화면 (Intro Section) --- */
.intro-visual {
    width: 130px;
    height: 130px;
    border-radius: 36px;
    background: var(--primary-gradient);
    margin: 30px auto 24px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5rem;
    box-shadow: 0 12px 35px rgba(255, 74, 139, 0.28);
    animation: float 3s ease-in-out infinite;
}

.intro-title {
    font-size: 1.85rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.35;
}

.intro-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 35px;
    word-break: keep-all;
}

.intro-meta-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 35px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.meta-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.meta-item i {
    font-size: 1.25rem;
    color: var(--primary);
}

.btn-start {
    width: 100%;
    padding: 20px;
    border-radius: 18px;
    border: none;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    box-shadow: 0 8px 24px rgba(255, 74, 139, 0.25);
}

.btn-start:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.btn-start:active {
    transform: translateY(0) scale(0.98);
}

/* --- B. 질문 풀이 화면 (Q&A Section) --- */
.qna-progress-container {
    width: 100%;
    margin-bottom: 25px;
}

.qna-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-eng);
    font-weight: 700;
    margin-bottom: 8px;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease-out;
}

/* 질문 카드 영역 */
.qna-card-container {
    position: relative;
    flex-grow: 1;
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.question-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    animation: fadeInCard 0.4s ease-out;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-title-box {
    margin-bottom: 30px;
}

.question-number {
    font-family: var(--font-eng);
    font-size: 1.5rem;
    font-weight: 850;
    color: var(--primary);
    margin-bottom: 8px;
}

.question-title {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.5;
    word-break: keep-all;
}

/* 답변지 리스트 */
.options-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.option-btn {
    width: 100%;
    padding: 20px 24px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-base);
    font-size: 1.05rem;
    text-align: left;
    cursor: pointer;
    line-height: 1.45;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.option-btn:hover {
    border-color: var(--primary);
    background-color: rgba(255, 74, 139, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.option-btn:active {
    transform: translateY(0) scale(0.98);
    background-color: rgba(255, 74, 139, 0.12);
}

/* --- C. 로딩 화면 (Analyzing Section) --- */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 60px 20px;
}

.loading-spinner-box {
    width: 90px;
    height: 90px;
    position: relative;
    margin-bottom: 35px;
}

.loading-spinner {
    width: 100%;
    height: 100%;
    border: 7px solid rgba(255, 255, 255, 0.03);
    border-top: 7px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--primary);
    animation: pulse 1.2s infinite;
}

.loading-text {
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
}

.loading-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
}

/* --- D. 결과 화면 (Result Section) --- */
.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-subtitle {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-family: var(--font-eng);
}

.result-title {
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1.35;
    word-break: keep-all;
}

/* 결과 대표 비주얼 카드 */
.result-visual-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 35px 25px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 12px 35px var(--glass-shadow);
}

.result-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
    display: inline-block;
    animation: float 4s ease-in-out infinite;
}

.result-badge {
    display: inline-block;
    padding: 5px 18px;
    border-radius: 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.result-summary-box {
    margin: 25px 0;
    text-align: left;
}

.result-summary-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

.result-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    word-break: keep-all;
    white-space: pre-wrap;
}

.result-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-feature-list li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.55;
    position: relative;
    padding-left: 20px;
}

.result-feature-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
}

/* 점수 매칭 차트 (점수형 테스트 용) */
.result-score-gauge-box {
    margin: 25px 0;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    width: 100%;
}

.gauge-title {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.gauge-title span.score-val {
    color: var(--primary);
    font-family: var(--font-eng);
    font-size: 1.2rem;
    font-weight: 700;
}

.gauge-bar-bg {
    height: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.gauge-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 1s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* 케미 카드 그리드 */
.chemistry-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 35px;
    width: 100%;
}

.chem-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 16px;
    text-align: center;
}

.chem-card.best {
    border-color: rgba(16, 185, 129, 0.25);
}

.chem-card.worst {
    border-color: rgba(239, 68, 68, 0.25);
}

.chem-label {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 10px;
}

.chem-card.best .chem-label {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent);
}

.chem-card.worst .chem-label {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.chem-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* 공유 및 제어 버튼 패널 */
.action-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
    width: 100%;
}

.btn-action {
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    border: none;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-action:active {
    transform: translateY(0) scale(0.98);
}

.btn-action.kakao {
    background-color: #fee500;
    color: #191919;
}

.btn-action.kakao:hover {
    background-color: #fdd835;
}

.btn-action.copy {
    background-color: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-action.copy:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.btn-action.retry {
    background: none;
    border: 1px dashed var(--text-muted);
    color: var(--text-secondary);
}

.btn-action.retry:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* 광고 슬롯 컨테이너 (애드센스 플레이스홀더) */
.ad-slot-container {
    margin: 25px 0;
    padding: 16px;
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.01);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* 복사 성공 토스트 메세지 */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------
   [3] 애니메이션 (Animations) 정의
   ---------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ----------------------------------------------------
   [4] 프리미엄 기능 업그레이드 스타일 (Canvas, History, Ad Captions)
   ---------------------------------------------------- */

.btn-action.download {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-action.download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

/* 메인 허브 최근 테스트 기록 스타일 */
.history-wrapper {
    background-color: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.history-header-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.history-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
}

.history-clear-btn:hover {
    color: var(--danger);
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    transition: all 0.2s;
    text-decoration: none;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.history-item-emoji {
    font-size: 1.8rem;
}

.history-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    overflow: hidden;
}

.history-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-result {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 광고 슬롯 스마트 캡션 */
.ad-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 25px;
    text-align: center;
    opacity: 0.75;
    display: block;
}

/* 백분율 텍스트 */
.gauge-percentile-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: center;
    font-weight: 700;
    line-height: 1.4;
    word-break: keep-all;
}

.gauge-percentile-text span.percentile-val {
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 900;
}

/* 브랜드 강조 및 추가 프리미엄 스타일 */
.brand-highlight {
    background: linear-gradient(135deg, #ffffff 0%, #ffeef4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(255, 74, 139, 0.15);
}

[data-theme="light"] .brand-highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-container {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    width: 100%;
}

.search-container .search-wrapper {
    flex: 1;
    margin-bottom: 0;
}

/* 랜덤 테스트 버튼 */
.btn-random {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid rgba(217, 70, 239, 0.3);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(217, 70, 239, 0.12) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(217, 70, 239, 0.1);
}

[data-theme="light"] .btn-random {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(217, 70, 239, 0.06) 100%);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.btn-random:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(217, 70, 239, 0.35);
    border-color: rgba(217, 70, 239, 0.8);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(217, 70, 239, 0.22) 100%);
}

.btn-random i {
    animation: diceRoll 2s infinite ease-in-out;
}

@keyframes diceRoll {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
}

@media (max-width: 600px) {
    .search-container {
        flex-direction: column;
    }
    .btn-random {
        padding: 14px 20px;
    }
}

/* 인기 해시태그 */
.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    align-items: center;
    width: 100%;
}

.trending-tags-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 4px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-badge:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tag-badge.active {
    background: var(--secondary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.25);
}

/* SEO 리치 텍스트 소개 섹션 */
.rich-seo-content {
    margin-top: 40px;
    padding: 26px;
    border-radius: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    text-align: left;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
}

.rich-seo-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.rich-seo-block {
    margin-bottom: 22px;
}

.rich-seo-block h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.rich-seo-block p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 6px;
    word-break: keep-all;
}

.rich-seo-block ul {
    list-style: none;
    padding-left: 0;
}

.rich-seo-block li {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
}

.rich-seo-block li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 4px;
}

.rich-seo-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.rich-seo-keywords .keyword-tag {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* 유사 추천 테스트 링크 */
.related-test-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.btn-related-test {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-break: keep-all;
    text-align: center;
}

.btn-related-test:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 74, 139, 0.08) 0%, rgba(255, 138, 0, 0.08) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 74, 139, 0.15);
}

.btn-related-test i {
    color: var(--primary);
    font-size: 0.95rem;
}

/* 로딩 화면 퍼센트 숫자 */
.loading-progress-num {
    font-family: var(--font-eng);
    font-size: 2.3rem;
    font-weight: 850;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

/* SNS 공유 박스 */
.sns-share-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
}

.sns-share-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.sns-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.sns-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: #ffffff;
    transition: all 0.25s ease;
}

.sns-btn.facebook {
    background-color: #1877f2;
}

.sns-btn.twitter {
    background-color: #000000;
    border-color: rgba(255, 255, 255, 0.15);
}

.sns-btn.line {
    background-color: #06c755;
}

.sns-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.sns-btn:active {
    transform: translateY(0) scale(0.95);
}

/* 피드백 모듈 스타일 */
.feedback-box {
    margin: 25px 0;
    padding: 24px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.feedback-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feedback-stars {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.feedback-star {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-star.active,
.feedback-star:hover {
    color: #f1c40f;
    transform: scale(1.15);
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}

.btn-feedback-option {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-feedback-option.active,
.btn-feedback-option:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(255, 74, 139, 0.05) 0%, rgba(255, 138, 0, 0.05) 100%);
}

.btn-feedback-submit {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-feedback-submit:hover {
    box-shadow: 0 4px 15px rgba(255, 74, 139, 0.3);
}

.feedback-thanks {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeIn 0.4s ease forwards;
}

.feedback-thanks-icon {
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.feedback-thanks-msg {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 700;
}

