/* 리스크 뉴스 대시보드 커스텀 스타일 */

/* 폰트 설정 */
body {
    font-family: 'Noto Sans KR', sans-serif;
}

/* 라인 클램프 유틸리티 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 수평 스크롤 컨테이너 */
.horizontal-scroll-container {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--bc) / 0.3) transparent;
}

.horizontal-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb {
    background-color: hsl(var(--bc) / 0.3);
    border-radius: 3px;
}

.horizontal-scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: hsl(var(--bc) / 0.5);
}

/* 카드 호버 효과 */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* 뱃지 스타일 */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* 모달 스타일 */
.modal-box {
    max-height: 90vh;
    overflow-y: auto;
}

/* 토스트 스타일 */
.toast {
    z-index: 9999;
}

/* 로딩 스피너 */
.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 반응형 그리드 */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 네비게이션 스타일 */
.navbar {
    backdrop-filter: blur(10px);
    background-color: hsl(var(--b1) / 0.9);
}

/* 섹션 네비게이션 */
#sectionNav {
    scroll-behavior: smooth;
}

#sectionNav button {
    white-space: nowrap;
    transition: all 0.2s ease;
}

#sectionNav button:hover {
    transform: scale(1.05);
}

/* 검색바 스타일 */
.input-group {
    position: relative;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* 카드 내용 스타일 */
.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    line-height: 1.4;
}

/* 중요도 별점 스타일 */
.text-warning {
    color: hsl(var(--wa));
}

/* 태그 스타일 */
.badge-outline {
    border: 1px solid hsl(var(--bc) / 0.2);
    background: transparent;
}

/* 모바일 최적화 */
@media (max-width: 640px) {
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .navbar-center {
        display: none;
    }
    
    /* 출처 링크 모바일 최적화 */
    .break-all {
        word-break: break-all;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* 카드 내부 텍스트 오버플로우 방지 */
    .card-body {
        overflow: hidden;
    }
    
    .card-title {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* 출처 링크 스타일 */
    .card-body a {
        word-break: break-all;
        overflow-wrap: break-word;
        max-width: 100%;
        display: inline-block;
        text-decoration: underline;
        color: hsl(var(--p));
    }
    
    .card-body a:hover {
        color: hsl(var(--pf));
        text-decoration: underline;
    }
}

/* 가로 모드 최적화 */
@media (max-width: 768px) and (orientation: landscape) {
    .card-body {
        padding: 0.75rem;
    }
    
    .card-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .text-xs {
        font-size: 0.7rem;
    }
    
    /* 출처 링크 가로 모드 최적화 */
    .break-all {
        font-size: 0.65rem;
        line-height: 1.2;
    }
}

/* 다크/라이트 테마 전환 애니메이션 */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--b2));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--bc) / 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--bc) / 0.5);
}

/* 포커스 스타일 */
.btn:focus,
.input:focus {
    outline: 2px solid hsl(var(--p));
    outline-offset: 2px;
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} 