/**
 * 파일명: assets/css/gift-ranking.css
 * 위치: /assets/css/
 * 기능: 판촉물 인기 순위(gift_ranking.php) 전용 스타일
 *
 * @version   1.2.0
 * @updated   2026-07-27
 * @standalone 원천 고유 디자인이다 — panchok/zengift 로 복사하지 않는다.
 *             팔레트 출처: ~/OneDrive/WEB/Projects/docs/design/design_system_03-dark-mono-clean.md
 *             허브·홈·세부 카테고리와 같은 팔레트·같은 컴포넌트 패턴을 재사용한다.
 * @changelog
 *   1.2.0 (2026-07-27) 히어로 빠른 메뉴(.rank-nav-link) 추가 — 마지막 업데이트 배지 옆
 *   1.1.0 (2026-07-27) FAQ 복원에 맞춰 .rank-faq-item 아코디언 스타일 추가(허브 .hub-faq-item 과 동일 패턴)
 *   1.0.0 (2026-07-27) 최초 작성 — 4단계 2차 본작업 마지막 페이지: 순위 화면 독자 디자인.
 *                      순위 뱃지(금·은·동)는 그라데이션 대신 테두리 색만 다르게 하는 방식으로
 *                      단순화(DS03 "그라데이션 없음" 원칙). 사용하지 않던 .stats-card 계열
 *                      (마크업에서 참조된 적 없음) 은 이식하지 않았다.
 */

body.rank-ds03 {
    --color-bg: #fbfbfc;
    --color-surface: #ffffff;
    --color-dot: #dcdde3;
    --color-accent: #111317;
    --color-accent-dark: #000000;
    --color-on-accent: #ffffff;
    --color-link: #2563eb;
    --color-text: #0c0d10;
    --color-text-muted: #71757e;
    --color-border: #d4d6dd;
    --color-success: #16a34a;
    --rank-gold: #d4a017;
    --rank-silver: #94a3b8;
    --rank-bronze: #b45309;
    --shadow: 0 1px 2px rgba(16, 18, 24, .04), 0 6px 24px rgba(16, 18, 24, .05);
    --radius: 16px;

    background-color: var(--color-bg);
    background-image: radial-gradient(var(--color-dot) 1px, transparent 1px);
    background-size: 22px 22px;
    background-position: -11px -11px;
    color: var(--color-text);
    word-break: keep-all;
}

@media (prefers-color-scheme: dark) {
    body.rank-ds03 {
        --color-bg: #0d0d0d;
        --color-surface: #1a1a1a;
        --color-dot: #232326;
        --color-accent: #f0f0f0;
        --color-accent-dark: #ffffff;
        --color-on-accent: #111317;
        --color-text: #e0e0e0;
        --color-text-muted: #888888;
        --color-border: #333333;
        --color-link: #60a5fa;
        --color-success: #22c55e;
        --rank-gold: #eab308;
        --rank-silver: #cbd5e1;
        --rank-bronze: #d97706;
        --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 24px rgba(0, 0, 0, .4);
    }
}

/* ===== 히어로 ===== */
.rank-hero {
    padding: 2.5rem 0 1.5rem;
    text-align: center;
}
.rank-hero h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0 0 .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.rank-hero h1 i { color: var(--rank-gold); }
.rank-hero p {
    color: var(--color-text-muted);
    font-size: 15px;
    margin: 0 0 1.1rem;
}
.rank-hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .6rem;
}
.rank-hero .home-badge,
.rank-hero .hub-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    box-shadow: var(--shadow);
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}
.rank-hero .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 15%, transparent);
    flex-shrink: 0;
}

/* 페이지가 길어(누적+월별 다수) 풋터까지 스크롤하지 않고 이동할 수 있는 빠른 메뉴(사용자 요청) */
.rank-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
.rank-nav-link:hover {
    border-color: #c7c9d0;
    color: var(--color-link);
}

/* ===== 순위 섹션 ===== */
.rank-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.rank-section-title {
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 1.25rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.rank-section-title i { color: var(--color-link); }
.rank-section-title small {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-left: 4px;
}
.rank-section-title.collapsible {
    cursor: pointer;
    justify-content: space-between;
    transition: color .15s;
}
.rank-section-title.collapsible:hover { color: var(--color-link); }
.rank-toggle-icon {
    margin-left: auto;
    color: var(--color-text-muted);
    transition: transform .3s;
}

/* ===== 순위 항목 ===== */
.rank-item {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: .75rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s;
}
.rank-item:last-child { margin-bottom: 0; }
.rank-item:hover { border-color: #c7c9d0; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    font-weight: 800;
    font-size: 15px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
}
.rank-badge.top-1 { border-color: var(--rank-gold); color: var(--rank-gold); }
.rank-badge.top-2 { border-color: var(--rank-silver); color: var(--rank-silver); }
.rank-badge.top-3 { border-color: var(--rank-bronze); color: var(--rank-bronze); }

.rank-thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.rank-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.rank-info {
    flex: 1;
    min-width: 0;
}
.rank-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-code {
    font-size: 12px;
    color: var(--color-text-muted);
}

.rank-count {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--color-link);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* ===== 자주 묻는 질문 ===== */
.rank-faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
}
.rank-faq-item summary {
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
}
.rank-faq-item summary::-webkit-details-marker { display: none; }
.rank-faq-item summary::before {
    content: '+';
    display: inline-block;
    width: 1.2em;
    color: var(--color-link);
    font-weight: 800;
}
.rank-faq-item[open] summary::before { content: '\2212'; }
.rank-faq-item p {
    margin: .6rem 0 0;
    padding-left: 1.2em;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 1.65;
}

/* ===== 빈 상태 ===== */
.rank-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--color-text-muted);
}
.rank-empty i {
    font-size: 2rem;
    margin-bottom: .6rem;
    display: block;
}

/* ===== 모바일 최적화 ===== */
@media (max-width: 576px) {
    .rank-section { padding: 1.25rem; }
    .rank-item { padding: .8rem; gap: .75rem; }
    .rank-badge { width: 30px; height: 30px; font-size: 13px; }
    .rank-thumb { width: 52px; height: 52px; }
    .rank-name { font-size: 13.5px; white-space: normal; }
    .rank-count { font-size: 13px; }
}
