/* css/components.css */

/* 1. Card UI (Step 1 & 2) */
.mono-card {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.mono-card:active { transform: scale(0.98); }

/* Step 2/3 그리드: 모바일에서 ? 버튼 숨김 (카드가 작아서 난잡함) */
.mono-card .hint-btn,
.rank-card .hint-btn {
    display: none;
}
@media (min-width: 640px) {
    .mono-card .hint-btn,
    .rank-card .hint-btn {
        display: flex;
        right: auto;
        left: 8px;
    }
}

/* 선택됐을 때 (Dark Mode Style) */
.mono-card.selected {
    background-color: #111827;
    color: white !important;
    border-color: #111827;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
.mono-card.selected i.main-icon { color: white !important; }
.mono-card.selected span { font-weight: 700; color: white !important; }

.check-circle { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.mono-card.selected .check-circle {
    background-color: #10B981;
    border-color: #10B981;
    transform: scale(1.1);
}

/* 1-B. Keyword Hint (? 아이콘 → 보완 설명) */
.hint-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}
.hint-btn:hover {
    background: #E5E7EB;
    color: #6B7280;
}
/* Step 1 카드 전용 — 큰 버전 */
.hint-btn-lg {
    width: 30px;
    height: 30px;
    font-size: 15px;
    top: 12px;
    right: 12px;
}
.hint-tooltip {
    position: absolute;
    top: 36px;
    left: 8px;
    right: 8px;
    background: #111827;
    color: white;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    padding: 10px 14px;
    border-radius: 10px;
    z-index: 10;
    word-break: keep-all;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    animation: hintFadeIn 0.2s ease;
}
.hint-tooltip-lg {
    top: 48px;
    left: 16px;
    right: 16px;
    font-size: 13px;
    padding: 14px 18px;
}
@keyframes hintFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
/* selected 상태에서 hint 버튼 스타일 */
.mono-card.selected .hint-btn {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.7);
}
.mono-card.selected .hint-btn:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* 2. Ranking Card (Step 3) */
.rank-card.ranked {
    border: 2px solid #4F46E5;
    background-color: #EEF2FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

/* 3. Result Screen (Receipt Style) */
.result-wrapper {
    background: white;
    max-width: 420px;
    width: 100%;
    margin: 0 auto 100px auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    position: relative;
}
/* 톱니바퀴 효과 */
.result-wrapper::before, .result-wrapper::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 10px;
    background-size: 20px 20px; background-repeat: repeat-x;
}
.result-wrapper::before {
    top: -10px;
    background-image: linear-gradient(135deg, white 50%, transparent 50%), linear-gradient(45deg, white 50%, transparent 50%);
    background-position: bottom;
}
.result-wrapper::after {
    bottom: -10px;
    background-image: linear-gradient(135deg, transparent 50%, white 50%), linear-gradient(45deg, transparent 50%, white 50%);
    background-position: top;
}

/* 4. Detail Card (Result) */
.detail-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.detail-header {
    padding: 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #f3f4f6;
}

/* 5. Blur & Lock UI */
.blur-container { 
    position: relative; padding: 0 20px 80px 20px;
    overflow: visible; min-height: 600px;
}
.blur-content { 
    filter: blur(6px); user-select: none; pointer-events: none; 
    opacity: 0.5; transform: scale(0.98);
}
.sticky-lock-wrapper {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    z-index: 50; pointer-events: none;
}
.sticky-badge {
    position: -webkit-sticky; position: sticky; 
    top: 40px; 
    margin: 0 auto; width: 90%; max-width: 320px;
    pointer-events: auto; 
    background: rgba(17, 24, 39, 0.95); 
    backdrop-filter: blur(10px);
    color: white; 
    padding: 24px; 
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5); 
    border: 1px solid rgba(255,255,255,0.15);
    display: flex; flex-direction: column; align-items: center; 
    gap: 12px; text-align: center;
    max-height: 85vh; overflow-y: auto;
    -ms-overflow-style: none; scrollbar-width: none; 
}
.sticky-badge::-webkit-scrollbar { display: none; }

/* 6. Modal */
.modal-overlay {
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   7. Result V2 — 5-Section Scroll Experience
   ========================================================================== */

/* v2: fixed 풀스크린 스크롤 컨테이너 — body/main 체인 완전 우회 */
#result-v2.rv2-active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9000;
    background: #F9FAFB;
    -webkit-overflow-scrolling: touch;
}

/* Hero Section — full viewport */
#rv2-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    background: white;
    position: relative;
}

#rv2-hero .rv2-brand {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #9CA3AF;
    margin-bottom: 24px;
}

#rv2-hero .rv2-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    border: 1.5px solid;
    background: white;
    margin-bottom: 16px;
}

.rv2-color-combo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    margin-bottom: 30px;
    width: 100%;
}
.rv2-color-circle {
    width: 61px;
    height: 61px;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}
.rv2-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.rv2-color-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    white-space: nowrap;
}
.rv2-color-x {
    font-size: 27px;
    font-weight: 300;
    color: #D1D5DB;
    margin-bottom: 20px;
}

#rv2-hero .rv2-title {
    font-size: 28px;
    font-weight: 900;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 12px;
}

#rv2-hero .rv2-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 8px;
}

#rv2-hero .rv2-desc {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.7;
    max-width: 380px;
    margin: 0 auto 24px;
    word-break: keep-all;
}

#rv2-hero .rv2-keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 400px;
    margin: 0 auto;
}

.rv2-scroll-arrow {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    animation: rv2Bounce 2s infinite;
    color: #D1D5DB;
    font-size: 24px;
}

@keyframes rv2Bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-12px); }
    60% { transform: translateX(-50%) translateY(-6px); }
}

/* Section base */
.rv2-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 80px;
}

/* Stats Section */
#rv2-stats {
    background: #F9FAFB;
}

.rv2-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #9CA3AF;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.rv2-section-desc {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.8;
    margin-bottom: 28px;
    max-width: 480px;
}
@media (min-width: 1024px) {
    .rv2-section-desc {
        display: none;
    }
}

#rv2-radar {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 32px;
}

#rv2-radar svg {
    width: 100%;
    height: auto;
}

#rv2-score-bars {
    width: 100%;
    max-width: 400px;
}

.rv2-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rv2-bar-label {
    font-size: 12px;
    font-weight: 700;
    color: #6B7280;
    width: 48px;
    text-align: right;
    flex-shrink: 0;
}

.rv2-bar-track {
    flex: 1;
    height: 10px;
    background: #E5E7EB;
    border-radius: 5px;
    overflow: hidden;
}

.rv2-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.8s ease;
}

.rv2-bar-value {
    font-size: 11px;
    font-weight: 800;
    color: #374151;
    width: 28px;
    flex-shrink: 0;
}

/* Dual Section (Strength / Weakness) */
#rv2-dual {
    background: white;
}

.rv2-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 640px;
}

@media (max-width: 640px) {
    .rv2-dual-grid {
        grid-template-columns: 1fr;
    }
}

.rv2-dual-card {
    border-radius: 16px;
    padding: 28px 24px;
    text-align: left;
}

.rv2-dual-card.strength {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
}

.rv2-dual-card.weakness {
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

.rv2-dual-card .rv2-dual-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.rv2-dual-card.strength .rv2-dual-label { color: #3B82F6; }
.rv2-dual-card.weakness .rv2-dual-label { color: #EF4444; }

.rv2-dual-card .rv2-dual-title {
    font-size: 16px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 10px;
}

.rv2-dual-card .rv2-dual-text {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.7;
    word-break: keep-all;
}

/* Top 3 Section */
#rv2-top3 {
    background: #F9FAFB;
    padding-top: 60px;
    padding-bottom: 60px;
    min-height: auto;
}

#rv2-top3 .rv2-rank-card-wrapper {
    width: 100%;
    max-width: 480px;
    margin-bottom: 20px;
}

.rv2-rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 12px;
}

/* CTA Section */
#rv2-cta {
    background: white;
    min-height: auto;
    padding: 48px 24px;
}

.rv2-cta-banner {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
    border: 1px solid #C7D2FE;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 32px;
}

.rv2-cta-banner p {
    font-size: 14px;
    color: #4338CA;
    font-weight: 600;
    line-height: 1.6;
}

.rv2-cta-btn {
    display: block;
    width: 100%;
    max-width: 480px;
    padding: 18px 24px;
    background: #111827;
    color: white;
    font-size: 16px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 24px;
}

.rv2-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
}

.rv2-cta-btn:active {
    transform: scale(0.98);
}

/* 전체저장 버튼: 모바일 숨김, PC만 표시 */
.rv2-btn-full-save {
    display: none;
}
@media (min-width: 1024px) {
    .rv2-btn-full-save {
        display: block;
    }
}

.rv2-community-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    max-width: 480px;
    margin-bottom: 24px;
}

.rv2-community-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.rv2-community-btn:hover {
    background: #F3F4F6;
}

.rv2-footer-text {
    font-size: 9px;
    color: #9CA3AF;
    letter-spacing: 2px;
    text-align: center;
}

/* Deep Analysis 블록 */
.rv2-deep-block {
    width: 100%;
    max-width: 640px;
    margin-top: 24px;
    padding: 28px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
}
.rv2-deep-block .rv2-deep-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #9CA3AF;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.rv2-deep-block .rv2-deep-persona {
    font-size: 16px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 12px;
}
.rv2-deep-block .rv2-deep-text {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.8;
    word-break: keep-all;
}

/* CTA 보조 버튼 */
.rv2-cta-btn-secondary {
    background: white;
    color: #111827;
    border: 2px solid #E5E7EB;
    box-shadow: none;
}
.rv2-cta-btn-secondary:hover {
    background: #F3F4F6;
    box-shadow: none;
}

/* 빈 슬라이더 영역 숨김 */
#rv2-slider-area:empty { display: none; }

/* ==========================================================================
   8. Result V2 — PC Layout (≥1024px) 병렬 비교 중심
   ========================================================================== */
@media (min-width: 1024px) {

    /* 3열 그리드: 메인좌 + 메인우 + CTA 사이드바 */
    #result-v2.rv2-active {
        display: grid;
        grid-template-columns: 1fr 1fr 300px;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "hero   stats  cta"
            "dual   dual   cta"
            "top3   top3   cta";
        max-width: 1280px;
        margin-left: auto;
        margin-right: auto;
        align-content: start;
        align-items: stretch; /* Hero/Stats 동일 높이 */
    }

    /* 풀뷰포트 높이 제거 — PC는 콘텐츠 높이만큼 */
    #rv2-hero,
    .rv2-section {
        min-height: auto;
    }

    /* 스크롤 화살표 숨김 */
    .rv2-scroll-arrow { display: none; }

    /* ── Hero (좌측 열) ── */
    #rv2-hero {
        grid-area: hero;
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
        padding: 60px 32px 60px 48px;
        background: white;
        border-bottom: 1px solid #E5E7EB;
    }
    #rv2-hero .rv2-desc {
        margin-left: 0;
        margin-right: 0;
    }
    #rv2-hero .rv2-keywords {
        justify-content: flex-start;
        margin-left: 0;
    }

    /* ── Stats / 레이더 차트 (우측, Hero 옆 동시 노출) ── */
    #rv2-stats {
        grid-area: stats;
        justify-content: flex-start;
        padding: 60px 48px 60px 32px;
        background: #F9FAFB;
        border-bottom: 1px solid #E5E7EB;
        border-left: 1px solid #E5E7EB;
    }

    /* ── Dual: 강점/그림자 좌우 비교 ── */
    #rv2-dual {
        grid-area: dual;
        padding: 48px;
        background: white;
        border-top: 1px solid #E5E7EB;
    }
    .rv2-dual-grid {
        max-width: 100%;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .rv2-dual-card {
        padding: 32px 28px;
    }
    .rv2-deep-block {
        max-width: 100%;
    }

    /* ── Top 3: 3카드 수평 그리드 + hover 상세 ── */
    #rv2-top3 {
        grid-area: top3;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
        gap: 20px;
        padding: 48px;
        background: #F9FAFB;
        border-top: 1px solid #E5E7EB;
    }
    #rv2-top3 .rv2-section-label {
        flex-basis: 100%;
        text-align: center;
    }
    #rv2-top3 .rv2-rank-card-wrapper {
        flex: 1;
        min-width: 200px;
        max-width: 340px;
        cursor: pointer;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        position: relative;
    }
    #rv2-top3 .rv2-rank-card-wrapper:hover {
        transform: translateY(-4px);
    }
    /* 순위 뱃지를 카드 위에 겹쳐서 배치 */
    #rv2-top3 .rv2-rank-number {
        position: absolute;
        top: -14px;
        left: 16px;
        z-index: 2;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    /* Top3: PC에서도 전체 내용 기본 표시 (hover 불필요) */

    /* ── CTA: 우측 스티키 패널 ── */
    #rv2-cta {
        grid-area: cta;
        position: sticky;
        top: 0;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: auto;
        padding: 32px 20px;
        border-left: 1px solid #E5E7EB;
        background: white;
        max-height: 100vh;
        overflow-y: auto;
    }
    .rv2-cta-banner {
        max-width: 100%;
        padding: 16px;
        margin-bottom: 20px;
    }
    .rv2-cta-banner p {
        font-size: 12px;
    }
    .rv2-cta-btn {
        max-width: 100%;
        font-size: 14px;
        padding: 14px 16px;
        margin-bottom: 16px;
    }
    .rv2-community-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 8px;
        margin-bottom: 16px;
    }
    .rv2-community-btn {
        padding: 10px;
        gap: 8px;
    }
    /* copyright은 CTA 사이드바에서 숨김 — 하단 별도 */
    #rv2-cta .rv2-footer-text {
        display: none;
    }
    #rv2-slider-area {
        display: none;
    }
}