@import url('variables.css');

/* Layout Containers */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    padding: 0;
    min-height: calc(100vh - var(--header-height));
}

/* Header */
.site-header {
    background-color: var(--color-bg-card);
    height: var(--header-height);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo a {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--color-secondary);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-sub);
    transition: var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

/* 현재 선택된 메인 메뉴는 더 굵게 표시 */
.nav-link.active {
    font-weight: var(--font-weight-bold);
}

/* 헤더 햄버거 메뉴 (모바일용) */
.header-nav-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
}

.header-nav-line {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #0f172a;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 8px 16px 12px;
        z-index: 999;
    }

    .nav-menu.is-open {
        display: flex;
    }

    .nav-link {
        padding: 10px 4px;
        text-align: left;
    }

    .header-nav-toggle {
        display: inline-flex;
    }
}

.header-admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #334155;
    color: #fff;
    font-size: 14px;
    transition: var(--transition-base);
    text-decoration: none;
}

.header-admin-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

.header-profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: visible;
    /* 빨간점 뽔직 이도로 visible */
    background: #e8e6e3;
    border: 1.5px solid #c4c4c4;
    flex-shrink: 0;
    text-decoration: none;
    transition: var(--transition-base);
    box-sizing: border-box;
    position: relative;
    /* new-dot 위치 기준 */
}

.header-profile-avatar:hover {
    opacity: 0.9;
    border-color: #a0a0a0;
}

.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    overflow: hidden;
}

/* 프로필 팝업 */
.header-profile-wrap {
    position: relative;
}

.header-profile-avatar {
    cursor: pointer;
    border: none;
    padding: 0;
}

.header-profile-wrap {
    position: relative;
}

.header-new-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #ffffff;
    box-sizing: content-box;
}

.header-new-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    color: #ef4444;
    background: #fee2e2;
}

.header-profile-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 16px 0 8px 0;
    z-index: 1001;
}

.header-profile-popup[hidden] {
    display: none !important;
}

.header-profile-popup-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px 4px;
}

.header-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
}

.header-profile-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #cce5ff;
    color: #004085;
    font-size: 12px;
    font-weight: 600;
}

.header-profile-email {
    font-size: 13px;
    color: #868e96;
    padding: 0 16px 12px;
    margin: 0;
    word-break: break-all;
}

.header-profile-nav {
    display: flex;
    flex-direction: column;
}

.header-profile-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 16px;
    font-size: 14px;
    color: #212529;
    text-decoration: none;
    transition: background 0.15s;
}

.header-profile-item:hover {
    background: #f1f3f5;
}

.header-profile-item i {
    width: 18px;
    text-align: center;
    color: #868e96;
}

.header-profile-divider {
    height: 1px;
    background: #e9ecef;
    margin: 6px 0 4px 0;
}

.header-profile-logout {
    color: #dc3545;
}

.header-profile-logout i {
    color: #dc3545;
}

.header-profile-logout:hover {
    background: #fff5f5;
}

/* 비로그인: 세로 구분선 · 로그인 · 회원가입 */
.header-action-sep {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: #d1d5db;
    flex-shrink: 0;
}

.header-login-link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: #4b5563;
    text-decoration: none;
    transition: var(--transition-base);
}

.header-login-link:hover {
    color: var(--color-primary);
}

.header-signup-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--color-secondary);
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    transition: var(--transition-base);
}

.header-signup-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Header Search (버튼 클릭 시 pill 형태 검색폼) */
.header-search {
    display: flex;
    align-items: center;
    position: relative;
}

.header-search-form {
    display: flex;
    align-items: center;
    width: 0;
    overflow: hidden;
    margin-left: 0;
    height: 40px;
    border-radius: 999px;
    background: transparent;
    border: none;
    transition: width 0.25s ease;
}

.header-search--open .header-search-form {
    width: 280px;
    margin-left: 0;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.header-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 14px 0 18px;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    background: transparent;
    color: var(--color-text-main);
}

.header-search-input::placeholder {
    color: #9ca3af;
}

.header-search-input:focus {
    outline: none;
}

/* 폼 열렸을 때 토글 버튼 숨김 → 돋보기는 pill 안쪽 하나만 */
.header-search--open .header-search-btn {
    display: none;
}

/* 포커스 링은 pill 형태로 (outline 제거로 파란 원 현상 방지) */
.header-search-form:focus-within {
    box-shadow: 0 0 0 2px var(--color-secondary);
}

.header-search-icon-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 0.95rem;
}

.header-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    border-radius: 999px;
}

.header-search-btn:hover {
    color: var(--color-secondary);
}

.header-search-btn:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Tablet: 검색 폼을 드롭다운처럼 위/아래로 띄워서 메뉴가 밀리지 않게 */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-search-form {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: 0;
        max-width: 360px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    }

    .header-search--open .header-search-form {
        width: min(360px, 100vw - 32px);
    }
}

.btn-login {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-base);
}

.btn-login:hover {
    background-color: var(--color-bg-base);
    border-color: var(--color-primary);
}

/* Hero Section */
.hero-section {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.8;
}

/* Home Landing Page Refactoring */
.search-hero-box {
    text-align: center;
    margin-bottom: 50px;
}

.hero-search-form {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero-search-input {
    padding: 18px 60px 18px 25px;
    border-radius: 50px;
    border: 1px solid #dfe6e9;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s;
}

.hero-search-input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.hero-search-btn {
    position: absolute;
    top: 5px;
    right: 6px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    border: none;
    background: none;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}

.hero-search-btn:hover {
    color: var(--color-primary);
}

.hero-search-btn i {
    font-size: 18px;
}

/* Section Blocks */
.section-block {
    margin-top: 60px;
}

.section-block:first-of-type {
    margin-top: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 22px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-more-link {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.section-more-link:hover {
    color: var(--color-primary);
}

/* Home Category Nav */
.home-cat-nav {
    margin-top: 60px;
    text-align: center;
}

.home-cat-grid {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.home-cat-pill {
    display: block;
    padding: 15px 25px;
    background: white;
    border: 1px solid #eee;
    border-radius: 50px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: 0.2s;
}

.home-cat-pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.home-cat-pill.view-all {
    background: #f8f9fa;
    color: #666;
}

.home-cat-pill.view-all:hover {
    background: #e2e8f0;
    color: #333;
}


/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: var(--font-size-sm);
    color: var(--color-text-sub);
    cursor: pointer;
    transition: var(--transition-base);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    border-color: var(--color-primary);
}

.filter-btn .filter-count {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.9;
}

.filter-btn.active .filter-count {
    opacity: 1;
}

/* Grid Layout */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Link Card */
.link-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

.card-thumbnail {
    height: 140px;
    background-color: transparent;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(12, 24, 54, 0.9);
    color: white;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    font-size: 11px;
    color: var(--color-secondary);
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    margin-bottom: 8px;
    color: var(--color-text-main);
    line-height: 1.4;
}

.card-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-sub);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: auto;
}

.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-btn:hover {
    color: #FFD700;
}

/* 카드 하단 액션: 즐겨찾기·방문하기 공통 스타일 */
.card-stats-actions .bookmark-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.card-stats-actions .bookmark-btn:hover {
    color: #e6b800;
    background: rgba(255, 215, 0, 0.12);
}

.card-stats-actions .bookmark-btn i.fa-solid {
    color: var(--color-primary);
}

.card-stats-actions .visit-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(12, 24, 54, 0.06);
    border: 1px solid rgba(12, 24, 54, 0.2);
    transition: var(--transition-base);
    text-decoration: none;
}

.card-stats-actions .visit-link:hover {
    background: rgba(12, 24, 54, 0.12);
    border-color: var(--color-primary);
    text-decoration: none;
}

.visit-link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.visit-link:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    background-color: #F7F9FA;
    border-top: 1px solid #e9ecef;
    margin-top: 64px;
    padding: 40px 0 28px;
    color: #495057;
    font-size: var(--font-size-sm);
}

.site-footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.site-footer-brand {
    flex: 1;
    min-width: 0;
}

.site-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #212529;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 8px;
}

.site-footer-logo-img {
    height: 19px;
    width: auto;
    transform: translateY(-2px);
    display: block;
}

.site-footer-tagline {
    font-size: 13px;
    color: #495057;
    line-height: 1.5;
    margin: 0;
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.site-footer-links a {
    color: #495057;
    text-decoration: none;
    font-size: 14px;
}

.site-footer-links a:hover {
    color: #212529;
}

.site-footer-sep {
    height: 1px;
    background: #e9ecef;
    margin: 24px 0 20px;
}

.site-footer-copy {
    text-align: center;
    font-size: 13px;
    color: #868e96;
    margin: 0;
}

/* My Links / Proficiency Section */
.my-dashboard {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 30px;
    margin-bottom: 40px;
}

.proficiency-panel {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.panel-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.proficiency-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-rank {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-main);
}

.user-rank span {
    color: var(--color-secondary);
    background-color: rgba(62, 115, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.overall-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--color-text-sub);
    font-weight: var(--font-weight-medium);
}

.progress-bar-main {
    height: 12px;
    background-color: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill-main {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 6px;
    transition: width 1s ease-out;
}

.encouragement-box {
    background-color: var(--color-bg-base);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--color-secondary);
}

.encourage-msg {
    font-size: var(--font-size-sm);
    color: var(--color-text-main);
    line-height: 1.6;
    margin: 0;
}

/* Card Mastery Indicator */
.card-mastery-wrap {
    margin-bottom: 15px;
}

.mastery-label {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.mastery-bar-bg {
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.mastery-bar-fill {
    height: 100%;
    background-color: var(--color-secondary);
    border-radius: 3px;
}

.mastery-plus-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 4px;
    background-color: rgba(62, 115, 255, 0.05);
    transition: var(--transition-base);
}

.mastery-plus-btn:hover {
    background-color: var(--color-secondary);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .my-dashboard {
        grid-template-columns: 1fr;
    }

    /* 모바일 헤더:
       - 로고 숨김
       - 햄버거 메뉴는 왼쪽
       - 검색 폼은 가운데 정렬 */
    .logo {
        display: none;
    }

    .site-header .container {
        justify-content: flex-start;
        gap: 8px;
    }

    .user-actions {
        flex: 1;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
        /* 안쪽 요소가 줄어들 수 있게 */
    }

    .header-nav-toggle {
        order: 0;
        /* 가장 왼쪽 */
        width: 32px;
        height: 32px;
        padding: 4px 6px;
        flex: 0 0 auto;
    }

    .header-search {
        order: 1;
        flex: 1 1 0;
        min-width: 0;
        /* 아주 작은 화면에서도 줄어들도록 */
        justify-content: center;
    }

    .header-search-form {
        width: 100%;
        max-width: 100%;
        /* 화면 폭 안에서만 사용 */
        margin-left: 0;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
    }

    .header-search-btn {
        display: none;
    }

    .header-profile-wrap,
    .header-login-link,
    .header-signup-btn,
    .header-admin-btn {
        order: 3;
        flex: 0 0 auto;
        /* 검색 영역이 먼저 줄어들도록 고정 폭 유지 */
        white-space: nowrap;
    }

    /* ... Existing Responsive ... */
    .filter-bar {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        white-space: nowrap;
    }
}

/* --- NEW HOME DESIGN --- */

/* Hero Buttons */
.hero-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-hero-primary {
    background-color: #00C896;
    /* Mint Green from image */
    color: white;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s;
    border: none;
    font-size: 16px;
}

.btn-hero-primary:hover {
    background-color: #00a87e;
    transform: translateY(-2px);
}

.btn-hero-white {
    background-color: white;
    color: #4b39ef;
    /* Purpleish text */
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s;
    border: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-hero-white:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

/* ========== 카드 섹션 공통 (홈·카테고리·직업별추천) ========== */
.top-one-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.load-more-wrap {
    text-align: center;
    margin-top: 32px;
    margin-bottom: 16px;
}

.load-more-btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #212529;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: #495057;
}

.load-more-btn:active {
    transform: scale(0.98);
}

.top-one-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 18px 18px 16px;
    text-align: center;
    position: relative;
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-one-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

/* 카드 전체 클릭 시 상세 이동 (즐겨찾기·방문링크 제외) */
.top-one-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 제목·아이콘·별점·뱃지 등은 클릭이 오버레이로 전달되도록 */
.top-one-card .top-one-badge,
.top-one-card .top-one-title,
.top-one-card .top-one-icon,
.top-one-card .card-rating-row,
.top-one-card .card-stats-meta,
.top-one-card .card-stats-actions {
    pointer-events: none;
}

/* 즐겨찾기·방문링크·수정버튼만 클릭 가능 (오버레이보다 위에, 반드시 클릭 가능) */
.top-one-card .card-bookmark-btn,
.top-one-card .visit-link-btn,
.top-one-card .card-edit-btn {
    z-index: 10;
    pointer-events: auto !important;
    cursor: pointer;
}

.top-one-card .card-bookmark-btn i {
    pointer-events: none;
}

.top-one-badge {
    font-weight: var(--font-weight-bold);
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
    color: var(--color-secondary);
    position: relative;
    z-index: 2;
}

.top-one-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-main);
    margin-bottom: 12px;
    line-height: 1.35;
    position: relative;
    z-index: 2;
}

.top-one-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    box-shadow: none;
    position: relative;
    z-index: 2;
}

.top-one-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    /* 가는 가로선과의 간격 */
    font-size: 12px;
    color: var(--color-text-sub);
    position: relative;
    z-index: 2;
    width: 100%;
}

/* 카드 하단 가는 가로선: .top-one-stats의 가상요소로 표현 */
.top-one-stats::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border-top: 1px solid #eee;
    pointer-events: none;
}

/* 무료·한국어 뱃지 왼쪽 정렬 */
.card-stats-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #9ca3af;
    /* 더 흐린 톤으로 조정 */
    flex: 1;
    min-width: 0;
}

.card-stats-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 카드 우측 상단 즐겨찾기 */
.card-bookmark-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    z-index: 10;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 1rem;
    margin: 0;
}

.card-bookmark-btn:hover {
    color: #e6b800;
    background: rgba(255, 215, 0, 0.12);
}

.card-bookmark-btn i.fa-solid {
    color: var(--color-primary);
}

/* 별점·댓글 행 (희미한 세로선으로 구분, 별점-라인 간격 확보) */
.card-rating-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text-main);
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.card-star {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 4px;
}

.card-star i::before {
    color: #e6b800;
}

.card-rating-sep {
    width: 1px;
    height: 14px;
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    margin: 0 2px;
}

.card-comment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    color: var(--color-text-sub);
}

.card-comment i {
    color: var(--color-text-muted);
}

/* 카드 내 짧은 도구 설명 (댓글 아래, 구분선 위) - 생략 없이 전체 표시 */
/* 카드 내 짧은 도구 설명: 최대 2줄, 말줄임표 처리 + 행 높이 균일 */
.card-desc-short {
    font-size: var(--font-size-sm);
    color: var(--color-text-sub);
    line-height: 1.4;
    margin: 6px 0 8px;
    /* 2줄까지만 표시 + 말줄임표 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 같은 라인 카드 높이 균일하게(항상 2줄 높이 공간 확보) */
    max-height: calc(1.4em * 2);
    min-height: calc(1.4em * 2);
}

/* 무료·한국어 박스 뱃지 (왼쪽 정렬) */
.card-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    /* 본문보다 한 단계 흐린 텍스트 */
    background: #f3f4f6;
    /* 연한 회색 배경 */
    border: 1px solid #e5e7eb;
    /* 옅은 테두리 */
}

/* 카드 수정 버튼 (관리자 전용, 방문링크 왼쪽) */
.card-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    transition: var(--transition-base);
    text-decoration: none;
}

.card-edit-btn:hover {
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
}

/* 바로 가기 아이콘 오른쪽 정렬 (눈에 덜 띄게) */
.visit-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    /* 더 연한 회색 배경 */
    color: #9ca3af;
    /* 흐린 아이콘 색상 */
    font-size: 13px;
    transition: var(--transition-base);
    text-decoration: none;
    margin-left: auto;
}

.visit-link-btn:hover {
    background: #e5e7eb;
    /* hover 시에도 과하지 않게 */
    color: #6b7280;
    text-decoration: none;
}

.top-one-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Job CTA Section */
.job-cta-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 50px;
    text-align: center;
    margin-top: 20px;
}

.job-cta-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.job-cta-desc {
    color: #666;
    margin-bottom: 30px;
}

.btn-job-cta {
    background-color: var(--color-primary);
    color: white;
    padding: 15px 40px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

/* Ranking Criteria */
.criteria-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
}

.criteria-item {
    text-align: center;
}

.criteria-icon-circle {
    width: 80px;
    height: 80px;
    background: #f0f4f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
    color: var(--color-primary);
}

.criteria-text {
    font-weight: bold;
    color: #333;
}

@media (max-width: 900px) {
    .top-one-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .criteria-grid {
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .top-one-grid {
        grid-template-columns: 1fr;
    }

    .criteria-grid {
        flex-direction: column;
        gap: 30px;
    }

    .hero-btns {
        flex-direction: column;
    }
}

/* LLM Toggle Switch */
.llm-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 24px;
    width: fit-content;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.llm-toggle-label {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.llm-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.llm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.llm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
}

.llm-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.llm-switch input:checked+.llm-slider {
    background-color: #3b82f6;
}

.llm-switch input:checked+.llm-slider:before {
    transform: translateX(20px);
}

/* Hide cards logic */
body.hide-llm [data-is-llm="1"] {
    display: none !important;
}

@media (max-width: 768px) {
    .llm-toggle-wrap {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 20px;
    }
}