/* Custom Design Enhancement CSS */

/* 카테고리 카드 고급 디자인 */
.category-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 24px !important;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b35, #ff8c42, #ff6b35);
    border-radius: 24px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 
        0 20px 40px rgba(255, 107, 53, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    border-color: var(--primary-color) !important;
}

.category-card:hover::before {
    opacity: 1;
}

/* 카테고리 헤더 글라스모피즘 */
.category-card-header {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.9) 0%, rgba(255, 140, 66, 0.9) 100%) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 24px 28px !important;
    position: relative;
    overflow: hidden;
}

.category-card-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.category-card:hover .category-card-header::after {
    left: 100%;
}

/* 카테고리 링크 네오모피즘 스타일 */
.category-link {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.06) !important;
    padding: 18px 24px !important;
    margin-bottom: 16px !important;
    position: relative;
    overflow: hidden;
}

.category-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 107, 53, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-link:hover {
    background: rgba(255, 107, 53, 0.05) !important;
    transform: translateX(5px) !important;
    box-shadow: 
        0 4px 12px rgba(255, 107, 53, 0.15),
        0 2px 4px rgba(255, 107, 53, 0.1) !important;
    border-color: var(--primary-color) !important;
}

.category-link:hover::before {
    opacity: 1;
}

/* 순위 배지 애니메이션 */
.category-rank {
    position: relative;
    z-index: 1;
}

.category-rank.top3 {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 50%, #ffab40 100%) !important;
    box-shadow: 
        0 4px 15px rgba(255, 107, 53, 0.4),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(255, 107, 53, 0.6), inset 0 -2px 5px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.2);
    }
}

/* 왕관 아이콘 회전 애니메이션 */
.crown-icon {
    display: inline-block;
    animation: crown-float 3s ease-in-out infinite;
}

@keyframes crown-float {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-3px) rotate(5deg);
    }
}

/* 사이트 이름 그라데이션 */
.category-link:hover .category-site-name {
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 링크 버튼 */
.link-badge {
    background: linear-gradient(135deg, #ff6b35, #ff8c42) !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.3) !important;
    transition: all 0.3s ease !important;
}

.link-badge:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4) !important;
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f8f8f8;
}

::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 페이지 전체 배경 패턴 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 140, 66, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 171, 64, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 더보기 버튼 아이콘 스타일 */
.category-more-btn .bi-plus-lg {
    font-size: 1.1em !important;
    transition: transform 0.3s ease !important;
    line-height: 1 !important;
}

.category-more-btn:hover .bi-plus-lg {
    transform: scale(1.2) !important;
}

/* 카테고리 카드 헤더 레이아웃 */
.category-card-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.category-card-title {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* 카테고리 카드 내부 그라데이션 오버레이 */
.category-card-body {
    position: relative;
    background: transparent !important;
}

.category-card-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.3), transparent);
}

/* 반응형 개선 */
@media (max-width: 768px) {
    .category-card {
        border-radius: 12px !important;
        margin-bottom: 12px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
    }
    
    .category-card-header {
        padding: 10px 14px !important;
        border-radius: 12px 12px 0 0 !important;
    }
    
    .category-card-body {
        padding: 0 !important;
    }
    
    .category-link {
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        padding: 10px 14px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        border: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        box-shadow: none !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .category-link:last-child {
        border-bottom: none !important;
        border-radius: 0 0 12px 12px !important;
    }
    
    .category-link::before {
        display: none !important;
    }
    
    .category-link:hover {
        transform: none !important;
        background: rgba(255, 107, 53, 0.05) !important;
    }
    
    /* 순위 배지 모바일 최적화 */
    .category-rank {
        animation: none !important;
    }
    
    .category-rank.top3::before {
        display: none !important;
    }
    
    /* 왕관 아이콘 숨김 */
    .crown-icon {
        display: none !important;
    }
}