/* 모델 카드 호버 효과를 위한 CSS 스타일 */
.product-card-hover:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.product-card-hover {
    transition: all 0.2s ease;
}

.model-card-clickable {
    text-decoration: none !important;
    color: inherit !important;
}

.model-card-clickable:hover {
    text-decoration: none !important;
    color: inherit !important;
}

/* 성능 최적화를 위한 스타일 */
.catalog-section {
    contain: layout style;
    will-change: contents;
}

.product-card-hover {
    contain: layout style;
    transition: all 0.2s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.mini-chart-container {
    contain: strict;
    will-change: auto;
}

.sort-header-button {
    contain: layout style;
    will-change: background-color;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sort-header-button:active {
    transform: scale(0.98);
}

/* 정렬 애니메이션 최적화 */
.catalog-table-body {
    transition: opacity 0.15s ease;
}

.catalog-table-body.sorting {
    opacity: 0.7;
}

/* 유니버스별 색상 변수 */
:root {
    --universe-us: #1976d2;
    --universe-compustat: #1976d2;
    --universe-kr: #20b2aa;
    --universe-krx: #20b2aa;
    --universe-kospi: #20b2aa;
    --universe-kosdaq: #4caf50;
    --universe-jp: #ff9800;
    --universe-eu: #9c27b0;
    --universe-cn: #f44336;
}

/* 유니버스 뱃지 호버 효과 */
.universe-badge:hover {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

/* 정렬 헤더 호버 효과 */
.sort-header-button:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
    transition: background-color 0.2s ease;
}

/* 수익률 표시 향상 */
.returns-positive {
    color: #4caf50 !important;
    font-weight: 600;
}

.returns-negative {
    color: #f44336 !important;
    font-weight: 600;
}

/* 미니 차트 컨테이너 */
.mini-chart-container {
    border-radius: 4px;
    overflow: hidden;
    background: transparent;
}

/* 모델 아바타 스타일 */
.model-avatar {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .product-card-hover {
        margin-bottom: 8px;
    }

    .returns-group {
        gap: 4px !important;
    }

    .model-name {
        font-size: 12px !important;
        line-height: 1.2 !important;
        max-width: 140px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .model-description {
        max-width: 120px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    /* 모바일에서 카드 내부 여백 조정 */
    .mantine-Card-root {
        padding: 8px !important;
    }

    /* 그리드 간격 줄이기 */
    .mantine-Grid-root {
        --mantine-spacing-sm: 4px !important;
    }

    /* 모바일에서 그리드 컬럼 명확한 구분 */
    .mantine-GridCol-root {
        flex-shrink: 0 !important;
        overflow: hidden !important;
    }

    /* 아바타 크기 줄이기 */
    .model-avatar {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }

    /* 배지 크기 조정 */
    .universe-badge, 
    .mantine-Badge-root {
        font-size: 9px !important;
        padding: 2px 6px !important;
        height: auto !important;
        min-height: 16px !important;
    }

    /* 모바일에서 정렬 헤더 완전히 숨기기 */
    .mantine-Grid-root[style*="display"] {
        display: none !important;
    }

    /* 미니 차트 크기 조정 - 모바일에서 더 크게 */
    .mini-chart-container {
        width: 100px !important;
        height: 50px !important;
    }
}

/* 매우 작은 화면 (480px 이하) */
@media (max-width: 480px) {
    .model-name {
        font-size: 11px !important;
        max-width: 100px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .model-description {
        max-width: 80px !important;
        font-size: 9px !important;
    }

    /* 수익률 텍스트 크기 */
    .mantine-Stack-root .mantine-Text-root {
        font-size: 9px !important;
    }

    /* 카드 패딩 더 줄이기 */
    .mantine-Card-root {
        padding: 6px !important;
    }

    /* 그룹 간격 최소화 */
    .mantine-Group-root {
        gap: 2px !important;
    }

    /* 스택 간격 최소화 */
    .mantine-Stack-root {
        gap: 1px !important;
    }

    /* 작은 화면에서 차트 더 크게 */
    .mini-chart-container {
        width: 120px !important;
        height: 60px !important;
    }
}

/* 태블릿 크기 (768px ~ 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .model-description {
        max-width: 250px !important;
    }

    .sort-header-button {
        min-width: 50px !important;
    }
}

/* 테이블 헤더 스타일 */
.catalog-header {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.03) 0%, rgba(25, 118, 210, 0.01) 100%);
    border-radius: 8px 8px 0 0;
}

/* 로딩 애니메이션 */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Refresh icon spinning animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.refresh-icon-spinning {
    animation: spin 1s linear infinite;
}

/* AppShell 모바일 최적화 */
@media (max-width: 768px) {
    .mantine-AppShell-main {
        padding: 8px !important;
    }
    
    .mantine-AppShell-navbar {
        width: 100% !important;
    }
    
    .mantine-Container-root {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    
    .mantine-AppShell-header .mantine-Group-root {
        gap: 8px !important;
    }
}

/* 네비게이션 링크 모바일 최적화 */
@media (max-width: 480px) {
    .nav-sub-link {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
    
    .mantine-NavLink-leftSection {
        margin-right: 8px !important;
    }
}

/* 스크롤바 스타일링 (모바일에서 더 얇게) */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 3px;
        height: 3px;
    }
    
    ::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}