/* ========================================
   Premium Main - 메인 페이지, 베스트글
   ======================================== */

/* 페이지 타이틀 */
.page-title-section {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    display: flex; align-items: center; gap: 12px;
}

.page-title-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.page-title-icon svg { width: 24px; height: 24px; color: white; }

.page-title h1 { font-size: 24px; font-weight: 700; margin: 0; }
.page-title p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* 게시판 안내 바 */
.board-info-bar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 10px 16px; margin-bottom: 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; font-size: 12px; color: var(--text-secondary);
}
.board-info-bar .board-info-edit:first-child { margin-left: 0; }
.board-info-bar .board-info-edit { margin-left: auto; }
.board-info-edit {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-main);
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
    text-decoration: none; padding: 0;
}
.board-info-edit:hover { background: var(--accent); color: white; border-color: var(--accent); }
.board-info-edit + .board-info-edit { margin-left: 6px; }
.board-info-item {
    display: flex; align-items: center; gap: 5px;
}
.board-info-item svg { color: var(--text-light); flex-shrink: 0; }
.board-info-item em {
    font-style: normal; font-weight: 700; color: var(--accent);
}

.write-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
    border: none; border-radius: 8px;
    color: white; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.3s;
    box-shadow: 0 2px 8px var(--accent-glow);
    text-decoration: none;
}

.write-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); color: white; }
.write-btn svg { width: 14px; height: 14px; }

/* 베스트 글 섹션 */
.best-section {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.best-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.best-tab {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.best-tab:hover {
    color: var(--text-primary);
    background: var(--bg-main);
}

.best-tab.active {
    color: var(--accent);
    background: var(--bg-main);
    border-bottom: 2px solid var(--accent);
    margin-bottom: -1px;
}

.best-list {
    display: flex;
    gap: 0;
}
.best-col {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.best-col:first-child {
    border-right: 1px solid var(--border);
}
.best-list .best-item { border: none !important; }

.best-empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

.best-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: none !important;
    outline: none;
}

.best-item:hover {
    background: var(--bg-main);
}

.rank-badge {
    width: 20px; height: 20px;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
    flex-shrink: 0;
}

.rank-1, .rank-badge.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.rank-2, .rank-badge.rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #1f2937; }
.rank-3, .rank-badge.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: #451a03; }
.rank-other, .rank-badge.rank-other { background: transparent; color: var(--text-light); font-weight: 600; }

.best-item-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.best-item-likes {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* 반응형 - 메인 */
@media (max-width: 768px) {
    .page-title-section {
        flex-direction: row;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
    }
    .page-title-icon { width: 40px; height: 40px; border-radius: 10px; }
    .page-title-icon svg { width: 20px; height: 20px; }
    .page-title h1 { font-size: 18px; }
    .page-title p { font-size: 11px; }
    .write-btn { padding: 6px 12px; font-size: 12px; }
    .write-btn svg { width: 12px; height: 12px; }

    .best-list {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   YaHub Main Page
   ======================================== */

.yh-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ─── Hero ─── */
.yh-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, #16213e 50%, #0f3460 100%);
    box-shadow: var(--shadow-md), 0 0 40px rgba(233, 69, 96, 0.08);
}

.yh-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(233, 69, 96, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.yh-hero-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 36px 40px;
}

.yh-hero-title {
    font-size: 42px;
    font-weight: 900;
    color: #f0f0f5;
    letter-spacing: -1px;
    line-height: 1.1;
}

.yh-accent {
    color: var(--accent);
    text-shadow: 0 0 24px rgba(233, 69, 96, 0.5);
}

.yh-hero-desc {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(240, 240, 245, 0.55);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.yh-hero-stats {
    display: flex;
    gap: 10px;
}

.yh-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    min-width: 100px;
    backdrop-filter: blur(8px);
    transition: transform 0.2s, background 0.2s;
}

.yh-stat-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.yh-stat-card.yh-stat-hot {
    border-color: rgba(233, 69, 96, 0.3);
    background: rgba(233, 69, 96, 0.08);
}

.yh-stat-card.yh-stat-hot .yh-stat-icon {
    color: var(--accent);
}

.yh-stat-card.yh-stat-hot .yh-stat-num {
    color: var(--accent);
}

.yh-stat-icon {
    color: var(--gold);
    line-height: 0;
}

.yh-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: #f0f0f5;
    letter-spacing: -0.5px;
    line-height: 1;
}

.yh-stat-label {
    font-size: 11px;
    color: rgba(240, 240, 245, 0.45);
    font-weight: 500;
}

/* ─── Section ─── */
.yh-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.yh-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.yh-tab-btns {
    display: flex;
    gap: 6px;
}

.yh-tab-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.yh-tab-btn:hover {
    border-color: #10b981;
    color: #10b981;
}

.yh-tab-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.yh-tab-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 4px;
}

.yh-tab-content {
    display: none;
}

.yh-tab-content.active {
    display: block;
}

.yh-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.yh-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.yh-icon-fire {
    background: linear-gradient(135deg, #ff6b35, var(--accent));
    color: #fff;
}

.yh-icon-new {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
}

.yh-icon-best {
    background: linear-gradient(135deg, var(--gold), #e6c84b);
    color: #78350f;
}

.yh-icon-comm {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

/* ─── Popular Grid ─── */
.yh-popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.yh-pop-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.25s;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.yh-pop-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    opacity: 0;
    transition: opacity 0.25s;
}

.yh-pop-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), 0 4px 20px rgba(233, 69, 96, 0.1);
}

.yh-pop-card:hover::before {
    opacity: 1;
}

.yh-pop-rank {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    background: var(--primary);
    color: var(--gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.yh-pop-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
    border: 1px solid rgba(233, 69, 96, 0.15);
    align-self: flex-start;
    letter-spacing: 0.3px;
}

[data-theme="dark"] .yh-pop-badge {
    background: rgba(233, 69, 96, 0.15);
}

.yh-pop-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.yh-pop-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-light);
    margin-top: auto;
}

.yh-pop-hit,
.yh-pop-good {
    display: flex;
    align-items: center;
    gap: 3px;
}

.yh-pop-good {
    color: var(--accent);
}

.yh-pop-time {
    margin-left: auto;
}

/* ─── Tabs Box ─── */
.yh-tabs-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.yh-tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.yh-tab-btn {
    flex: 1;
    padding: 13px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
    margin-bottom: -1px;
}

.yh-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-main);
}

.yh-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
}

.yh-tabs-body {
    padding: 0;
}

.yh-tab-panel {
    display: none;
}

.yh-tab-panel.active {
    display: block;
}

/* ─── Latest List ─── */
.yh-latest-list {
    display: flex;
    flex-direction: column;
}

.yh-latest-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.yh-latest-row:last-child {
    border-bottom: none;
}

.yh-latest-row:hover {
    background: var(--bg-main);
}

.yh-latest-num {
    width: 22px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    flex-shrink: 0;
}

.yh-latest-row:nth-child(-n+3) .yh-latest-num {
    color: var(--accent);
}

.yh-latest-subject {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yh-latest-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-light);
    flex-shrink: 0;
}

.yh-latest-author {
    color: var(--text-secondary);
    font-weight: 500;
}

.yh-latest-hit,
.yh-latest-cmt {
    display: flex;
    align-items: center;
    gap: 2px;
}

.yh-latest-cmt {
    color: var(--accent);
}

.yh-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-top: 1px solid var(--border);
    transition: all 0.2s;
}

.yh-more-btn:hover {
    color: var(--accent);
    background: var(--bg-main);
}

/* ─── Best Board Label ─── */
.yh-best-board {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg-main);
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ─── Community Grid ─── */
.yh-comm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.yh-comm-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.yh-comm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.yh-comm-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.yh-comm-all {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

.yh-comm-all:hover {
    color: var(--accent);
}

.yh-comm-list {
    display: flex;
    flex-direction: column;
}

.yh-comm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 18px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.yh-comm-item:last-child {
    border-bottom: none;
}

.yh-comm-item:hover {
    background: var(--bg-main);
}

.yh-comm-subject {
    font-size: 13px;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.yh-comm-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.yh-comm-cmt {
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
}

.yh-comm-time {
    font-size: 11px;
    color: var(--text-light);
}

/* ─── Empty ─── */
.yh-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    grid-column: 1 / -1;
}

.yh-empty-sm {
    padding: 24px 16px;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .yh-hero-inner {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
        gap: 20px;
    }

    .yh-hero-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .yh-popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .yh-main {
        gap: 20px;
    }

    .yh-hero-title {
        font-size: 32px;
    }

    .yh-hero-desc {
        font-size: 11px;
        letter-spacing: 1.5px;
    }

    .yh-hero-stats {
        gap: 8px;
    }

    .yh-stat-card {
        min-width: 80px;
        padding: 12px 14px;
    }

    .yh-stat-num {
        font-size: 18px;
    }

    .yh-popular-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .yh-pop-card {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
    }

    .yh-pop-rank {
        position: static;
        flex-shrink: 0;
    }

    .yh-pop-badge {
        display: none;
    }

    .yh-pop-title {
        flex: 1;
        -webkit-line-clamp: 1;
    }

    .yh-pop-meta {
        display: none;
    }

    .yh-comm-grid {
        grid-template-columns: 1fr;
    }

    .yh-section-title {
        font-size: 16px;
    }

    .yh-section-icon {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .yh-section-icon svg {
        width: 15px;
        height: 15px;
    }

    .yh-latest-info {
        gap: 6px;
    }

    .yh-latest-author {
        display: none;
    }

    .yh-latest-row {
        padding: 10px 14px;
    }

    .yh-comm-item {
        padding: 8px 14px;
    }

    .best-section .best-item {
        padding: 8px 14px;
    }
}
