/* ============================================
   링크네비 (LinkNavi) - 홈 페이지 스타일
   작성일: 2025-08-19
   ============================================ */

/* ============================================
   1. 컴팩트 헤더
   ============================================ */
.compact-header {
    background: var(--gradient-dark);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.compact-header h1 {
    font-size: 1.5rem;
}

.compact-header .text-muted {
    font-size: 0.9rem;
    color: #999 !important;  /* 가독성 개선 */
}

/* ============================================
   2. 미니 통계 바
   ============================================ */
.mini-stats-bar {
    background: linear-gradient(135deg, #0a0a0a, #151515);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.stat-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.stat-mini strong {
    color: var(--primary-gold);
    font-variant-numeric: tabular-nums;
}

.stat-mini .text-muted {
    color: #999 !important;  /* 통계 라벨 가독성 개선 */
}

.stat-mini .pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   3. 배너 섹션 개선
   ============================================ */
.banner-section {
    position: relative;
}

.banner-section h2 {
    font-size: 1.25rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: var(--font-size-lg);
}

.banner-link {
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* border-radius 제거 - 각진 디자인 */
    /* transition을 특정 속성으로 제한 - 부자연스러운 움직임 방지 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease, z-index 0s;
}

/* 프리미엄 배너 호버 효과 강화 */
.premium-banner-item .banner-link {
    border: 2px solid var(--primary-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.premium-banner-item .banner-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.4), 
        transparent);
    transition: left 0.8s ease;
    z-index: 1;
    pointer-events: none;
}

.premium-banner-item .banner-link:hover {
    border-color: #ffed4e;
    border-width: 3px;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        0 10px 40px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    z-index: 100;
}

.premium-banner-item .banner-link:hover::before {
    left: 100%;
}

/* 일반 배너 호버 효과 강화 */
.standard-banner-item .banner-link {
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.standard-banner-item .banner-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.3), 
        transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.standard-banner-item .banner-link:hover {
    border-color: var(--primary-gold);
    /* border-width 변경 제거 - 부자연스러운 움직임 방지 */
    box-shadow: 
        0 5px 25px rgba(255, 215, 0, 0.4),
        0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 50;
}

.standard-banner-item .banner-link:hover::before {
    left: 100%;
}

/* 배너 이미지 호버 효과 */
.banner-link .banner-image {
    transition: filter 0.4s ease;  /* transition을 filter로만 제한 */
    width: 100%;
    height: 100%;
    object-fit: contain;  /* cover에서 contain으로 변경 - 이미지 전체가 보이도록 */
    background: #000;  /* 빈 공간은 검은색으로 */
}

/* 프리미엄 배너 이미지는 꽉 차게 */
.premium-banner-item .banner-link .banner-image {
    object-fit: contain;  /* 이미지가 잘리지 않고 전체가 보이도록 */
}

.banner-link:hover .banner-image {
    /* 밝기와 대비 효과만 유지, 확대 효과 없음 */
    filter: brightness(1.05) contrast(1.05);
}

/* Featured 배너 특별 효과 */
.premium-banner-item.featured .banner-link {
    animation: goldenPulse 3s ease-in-out infinite;
}

@keyframes goldenPulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.5),
            inset 0 0 10px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 0 35px rgba(255, 215, 0, 0.8),
            inset 0 0 15px rgba(255, 215, 0, 0.2);
    }
}


.btn-outline-gold {
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    background: transparent;
    transition: all var(--transition-base);
}

.btn-outline-gold:hover {
    background: var(--primary-gold);
    color: var(--primary-black);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.bg-dark-subtle {
    background: linear-gradient(135deg, #0a0a0a, #151515);
}

/* ============================================
   4. 카테고리 섹션
   ============================================ */
.categories-section {
    background: var(--gradient-dark);
}

.category-card {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-gold);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.category-header {
    background: var(--gradient-gold);
    color: var(--primary-black);
    padding: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.category-body {
    padding: 1.5rem;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li {
    margin-bottom: 0.75rem;
}

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-gold);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
}

.link-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

/* ============================================
   랭킹 시스템 스타일
   ============================================ */
/* 랭킹별 배경 스타일 */
.link-list .rank-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    border: 2px solid #FFD700;
    animation: shimmer 3s ease-in-out infinite;
    border-radius: 8px;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem;
}

.link-list .rank-silver {
    background: linear-gradient(135deg, #C0C0C0, #808080) !important;
    border: 2px solid #C0C0C0;
    border-radius: 8px;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem;
}

.link-list .rank-bronze {
    background: linear-gradient(135deg, #CD7F32, #8B4513) !important;
    border: 2px solid #CD7F32;
    border-radius: 8px;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem;
}

.link-list .rank-top5 {
    background: linear-gradient(135deg, #9370DB, #8A2BE2) !important;
    border: 1px solid #9370DB;
    border-radius: 8px;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem;
}

.link-list .rank-top10 {
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem;
}

.link-list .rank-top10-last {
    background: linear-gradient(135deg, #32CD32, #228B22) !important;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem;
}

/* 메달 & 순위 표시 */
.rank-medal {
    font-size: 1.3em;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.rank-number {
    font-weight: bold;
    min-width: 35px;
    display: inline-block;
    font-size: 0.95em;
}

/* 1-3위 특별 효과 */
.rank-gold .link-item,
.rank-silver .link-item,
.rank-bronze .link-item {
    color: #000 !important;
    font-weight: 600;
    background: transparent !important;
    padding: 0 !important;
}

.rank-gold .link-item:hover,
.rank-silver .link-item:hover,
.rank-bronze .link-item:hover {
    transform: none;
    opacity: 0.9;
}

/* 4-10위 텍스트 색상 */
.rank-top5 .link-item,
.rank-top10 .link-item,
.rank-top10-last .link-item {
    color: #fff !important;
    background: transparent !important;
    padding: 0 !important;
}

.rank-top5 .link-item:hover,
.rank-top10 .link-item:hover,
.rank-top10-last .link-item:hover {
    transform: none;
    opacity: 0.9;
}

/* 애니메이션 효과 */
@keyframes shimmer {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
}

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

/* 링크 텍스트 스타일 */
.link-list li .link-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 0.5rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .rank-medal {
        font-size: 1.1em;
    }
    
    .rank-number {
        min-width: 28px;
        font-size: 0.85em;
    }
    
    .link-list li {
        padding: 0.5rem !important;
    }
}

.link-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-views {
    color: #ccc;  /* 더 밝은 회색으로 변경 - 검은 배경에서 잘 보이도록 */
    font-size: var(--font-size-sm);
    white-space: nowrap;
    margin-left: 1rem;
}

/* ============================================
   5. CTA 섹션
   ============================================ */
.cta-section {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}

.cta-compact {
    background: var(--gradient-dark);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--border-radius-base);
    padding: 1.5rem;
}

.cta-compact h3 {
    color: var(--primary-gold);
}

/* ============================================
   6. 반응형 디자인
   ============================================ */
@media (max-width: 768px) {
    .compact-header h1 {
        font-size: 1.25rem;
    }
    
    .compact-header .text-muted {
        display: none;
    }
    
    .mini-stats-bar {
        font-size: 0.8rem;
    }
    
    .banner-section h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .compact-header {
        text-align: center;
    }
    
    .compact-header .col-md-4 {
        margin-top: 0.5rem;
    }
    
    .stat-mini {
        font-size: 0.75rem;
    }
    
    .stat-mini .small {
        display: none;
    }
    
    .cta-compact {
        padding: 1rem;
    }
    
    .cta-compact h3 {
        font-size: 1rem;
    }
}

/* ============================================
   7. 접근성 개선
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 포커스 스타일 */
.btn:focus,
.link-item:focus,
.banner-link:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* 스크린 리더 전용 텍스트 */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================
   8. 로딩 상태
   ============================================ */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

.text-gold {
    color: var(--primary-gold) !important;
}

/* ============================================
   9. 추가 유틸리티
   ============================================ */
.text-secondary-gold {
    color: var(--secondary-gold) !important;
}

.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
}

.badge.bg-dark {
    background: var(--gradient-dark) !important;
    border: 1px solid rgba(255, 215, 0, 0.3);
}