/* 전체 레이아웃 */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container-fluid {
    padding: 0;
    min-height: 100vh;
}

/* 사이드바 스타일 */
.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-header h4 {
    margin: 0;
    font-weight: 600;
}

.sidebar-header i {
    margin-right: 10px;
    color: #ffd700;
}

/* 폼 스타일 */
.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: white;
}

.form-control, .form-select {
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    background-color: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background-color: white;
    box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.25);
    border-color: #ffd700;
}

/* 버튼 스타일 */
.btn {
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
    border: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* 메인 콘텐츠 스타일 - 사이드바 제거 후 전체 폭 최적화 */
.main-content {
    padding: 20px 40px;
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
    background-color: #f4f7f6;
}

/* 탭 네비게이션 스타일 강화 */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    background: white;
    padding: 10px 20px 0;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 25px;
    transition: all 0.2s;
}

.nav-tabs .nav-link.active {
    color: #0d6efd !important;
    background: transparent;
    border-bottom: 3px solid #0d6efd;
}

/* 모바일 대응 미디어 쿼리 */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .content-header h2 {
        font-size: 1.5rem;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

.content-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.content-header h2 {
    color: #495057;
    font-weight: 600;
    margin: 0;
}

.content-header i {
    margin-right: 10px;
    color: #667eea;
}

.analysis-period-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.analysis-period-group {
    width: 180px;
}

.page-header-action,
.header-action-group,
.trend-chart-actions,
.result-controls-toolbar,
.result-controls-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-controls-select-sm {
    width: 120px;
}

.result-controls-select-xs {
    width: 100px;
}

/* 카드 스타일 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    border: none;
    padding: 15px 20px;
}

.card-body {
    padding: 25px;
}

/* 진행 상태 스타일 */
.progress {
    height: 20px;
    border-radius: 10px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(45deg, #28a745, #20c997);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    color: white;
}

/* 상태 메시지 */
#statusMessage {
    font-size: 16px;
    color: #6c757d;
    margin: 0;
}

/* 결과 카드 */
#resultCard .card-body {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 12px;
}

#resultCard .card-title {
    color: #155724;
    font-weight: 600;
}

/* 오류 카드 */
#errorCard .card-body {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-radius: 12px;
}

#errorCard .card-title {
    color: #721c24;
    font-weight: 600;
}

/* 도움말 카드 */
#helpCard .card-body {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-radius: 12px;
}

#helpCard .card-title {
    color: #0c5460;
    font-weight: 600;
}

#helpCard ol {
    color: #0c5460;
    margin-bottom: 20px;
}

#helpCard ol li {
    margin-bottom: 8px;
}

.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .sidebar {
        height: auto;
        min-height: 100vh;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .card-body {
        padding: 20px 15px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* 로딩 스피너 */
.spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 8px;
}

/* 버튼 아이콘 */
.btn i {
    margin-right: 8px;
}

/* 폼 그룹 간격 */
.mb-3 {
    margin-bottom: 1.5rem !important;
}

/* 그리드 간격 */
.row {
    margin-left: -10px;
    margin-right: -10px;
}

.col-6 {
    padding-left: 10px;
    padding-right: 10px;
}

/* 분석 기능 섹션 스타일 */
.analysis-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.analysis-title {
    color: #ffd700;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.analysis-title small {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.7);
}

.analysis-form .form-label {
    font-size: 0.85em;
    margin-bottom: 5px;
}

.analysis-form .form-control,
.analysis-form .form-select {
    font-size: 0.85em;
    padding: 6px 8px;
}

.analysis-form .btn {
    font-size: 0.8em;
    padding: 6px 12px;
}

/* 트렌드 조회 결과 스타일 */
#trendResultCard .card-body {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
}

#trendResultCard .card-title {
    color: #1565c0;
    font-weight: 600;
}

#trendDataContainer {
    max-height: 400px;
    overflow-y: auto;
}

.trend-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.trend-data-table th,
.trend-data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.trend-data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.trend-data-table tr:hover {
    background-color: #f5f5f5;
}

/* 트렌드 조회 진행 상태 스타일 */
#trendStatusCard .card-body {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 12px;
}

#trendStatusCard .card-title {
    color: #ef6c00;
    font-weight: 600;
}

/* 작은 폼 요소들 */
.form-control-sm,
.form-select-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.btn-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* 버튼 그룹 스타일 */
.btn-outline-light {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-light:hover {
    color: #000;
    background-color: white;
    border-color: white;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    color: white;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* 사용법 안내 개선 */
#helpCard .card-body h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 10px;
}

#helpCard .card-body h6 i {
    margin-right: 8px;
    color: #667eea;
}

#helpCard .card-body ol {
    font-size: 0.9em;
    line-height: 1.6;
}

#helpCard .card-body ol li {
    margin-bottom: 5px;
}

/* 카테고리 관리 섹션 스타일 */
.category-management {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-management h6 {
    color: #ffd700;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.category-management h6 i {
    margin-right: 8px;
}

/* 카테고리 선택 컨테이너 */
.category-selection-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 선택된 카테고리 표시 */
.selected-category {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.selected-path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-path .badge {
    font-size: 0.9em;
    padding: 6px 12px;
}

/* 카테고리 드롭다운 스타일 */
.category-dropdowns {
    margin-top: 15px;
}

.category-dropdowns .form-label {
    font-size: 0.85em;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.9);
}

.category-dropdowns .form-select {
    font-size: 0.85em;
    padding: 6px 8px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.category-dropdowns .form-select:focus {
    background-color: white;
    border-color: #ffd700;
    box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.25);
}

.category-dropdowns .form-select:disabled {
    background-color: rgba(255, 255, 255, 0.5);
    color: rgba(0, 0, 0, 0.5);
    cursor: not-allowed;
}

/* 카테고리 선택 버튼 스타일 */
.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
    background-color: transparent;
}

.btn-outline-primary:hover {
    color: white;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    color: white;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* 카테고리 선택 상태 표시 */
.category-selection-container .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    font-style: italic;
}

/* 네이버 스타일 카테고리 선택기 */
.naver-category-selector {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 60px;
}

.naver-dropdown-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.naver-dropdown {
    position: relative;
    display: inline-block;
    min-width: 120px;
}

.naver-dropdown-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 120px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
}

.naver-dropdown-btn:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.naver-dropdown-btn.active {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.naver-dropdown-btn:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.naver-dropdown-btn .arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.naver-dropdown-btn.active .arrow {
    transform: rotate(180deg);
}

.naver-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.naver-dropdown-list.show {
    display: block;
}

.naver-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
}

.naver-dropdown-item:hover {
    background-color: #f8f9fa;
}

.naver-dropdown-item.active {
    background-color: #007bff;
    color: white;
}

.naver-dropdown-item:first-child {
    border-radius: 4px 4px 0 0;
}

.naver-dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}

/* 선택된 카테고리 경로 표시 */
.selected-category-path {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.selected-category-path .path-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.selected-category-path .path-value {
    font-size: 14px;
    color: white;
    font-weight: 500;
}

.selected-category-path .path-value .separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.5);
}

/* 로딩 상태 */
.naver-dropdown-loading {
    position: relative;
}

.naver-dropdown-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* 반응형 카테고리 선택 */
@media (max-width: 768px) {
    .naver-dropdown-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .naver-dropdown {
        width: 100%;
    }
    
    .naver-dropdown-btn {
        width: 100%;
    }
    
    .selected-path {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .selected-path .btn {
        margin-top: 8px;
    }
    
    .category-dropdowns .form-select {
        font-size: 0.8em;
    }
}

/* ==================== 트렌드 차트 스타일 ==================== */

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* 차트 통계 카드 */
.chart-stats .card {
    margin-bottom: 0;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.chart-stats .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.chart-stats .card-body {
    padding: 15px;
    text-align: center;
}

.chart-stats .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    opacity: 0.9;
}

.chart-stats h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* 차트 설정 폼 */
#trendChartForm .form-label {
    color: #495057;
    font-weight: 500;
    margin-bottom: 8px;
}

#trendChartForm .form-control,
#trendChartForm .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
    background-color: white;
    transition: all 0.3s ease;
}

#trendChartForm .form-control:focus,
#trendChartForm .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 키워드 검색 리스트 스타일 제거됨 (카테고리 선택만 사용) */

/* 차트 버튼 */
#downloadChartBtn,
#clearChartBtn {
    margin-left: 8px;
}

/* 차트 로딩 상태 */
.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #6c757d;
}

.chart-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

/* 차트 오류 상태 */
.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #dc3545;
}

.chart-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 차트 빈 상태 */
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #6c757d;
}

.chart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 차트 범례 스타일 */
.chart-legend {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 20px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #495057;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
}

/* 차트 툴팁 커스터마이징 */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    border: none !important;
    border-radius: 6px !important;
    color: white !important;
    font-size: 0.9rem !important;
    padding: 10px 15px !important;
}

.chartjs-tooltip-title {
    font-weight: 600 !important;
    margin-bottom: 5px !important;
}

.chartjs-tooltip-body {
    margin: 0 !important;
}

.chartjs-tooltip-body-item {
    margin: 2px 0 !important;
}

/* 반응형 차트 */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .chart-stats .row {
        margin: 0 -5px;
    }
    
    .chart-stats .col-md-3 {
        padding: 0 5px;
        margin-bottom: 10px;
    }
    
    .chart-stats .card-body {
        padding: 10px;
    }
    
    .chart-stats h4 {
        font-size: 1.2rem;
    }
    
    .chart-stats .card-title {
        font-size: 0.8rem;
    }
    
    .chart-legend {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

/* 차트 애니메이션 */
@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-container canvas {
    animation: chartFadeIn 0.5s ease-out;
}

/* 차트 제목 스타일 */
.chart-title {
    text-align: center;
    margin-bottom: 20px;
    color: #495057;
    font-weight: 600;
}

.chart-title h5 {
    margin: 0;
    font-size: 1.2rem;
}

.chart-title i {
    margin-right: 8px;
    color: #007bff;
}

/* 차트 컨트롤 버튼 */
.chart-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    gap: 8px;
}

.chart-controls .btn {
    font-size: 0.85rem;
    padding: 6px 12px;
}

/* 차트 데이터 테이블 (선택사항) */
.chart-data-table {
    margin-top: 20px;
    font-size: 0.9rem;
}

.chart-data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-top: none;
}

.chart-data-table td {
    vertical-align: middle;
}

.chart-data-table .badge {
    font-size: 0.8rem;
}

/* 차트 필터 스타일 */
.chart-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.chart-filters .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.chart-filters .form-control,
.chart-filters .form-select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.9rem;
}

.chart-filters .form-control:focus,
.chart-filters .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 차트 통계 요약 */
.chart-summary {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

.chart-summary h6 {
    color: #1565c0;
    font-weight: 600;
    margin-bottom: 10px;
}


.chart-summary p {
    color: #0d47a1;
    margin: 0;
    font-size: 0.9rem;
}

/* 3-Track 전략 카드 고도화 */
.strategy-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hit-rate-label {
    opacity: 0.8;
    margin-right: 5px;
}

.hit-rate-value {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* MD 피드백 액션 피드 */
.md-feedback-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.md-feedback-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.md-feedback-btn.active-correct {
    background-color: #28a745 !important;
    color: white !important;
    opacity: 1;
}

.md-feedback-btn.active-wrong {
    background-color: #dc3545 !important;
    color: white !important;
    opacity: 1;
}

.relative-index-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: #e9ecef;
    border-radius: 4px;
    color: #495057;
    border: 1px solid #dee2e6;
}

.outlier-highlight {
    color: #dc3545;
    font-weight: bold;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* --- 전략 카드 툴팁 및 호버 효과 강화 --- */
.info-tooltip {
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    cursor: help;
}

.info-tooltip:hover {
    opacity: 1;
}

.card-title .info-tooltip {
    vertical-align: middle;
}

/* 5-Track 전략 카드 호버 인터랙션 */
#strategy .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#strategy .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}

@media (max-width: 768px) {
    .container-fluid,
    .main-content {
        min-height: 100dvh;
    }

    .main-content {
        padding: 14px;
    }

    .content-header {
        margin-bottom: 20px;
    }

    .content-header,
    .content-header.d-flex {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .content-header h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .page-header-action,
    .header-action-group,
    .trend-chart-actions,
    .result-controls-toolbar,
    .result-controls-group {
        width: 100%;
    }

    .page-header-action .btn,
    .header-action-group .btn,
    .trend-chart-actions .btn,
    .result-controls-toolbar .btn,
    .result-controls-group .btn,
    .result-controls-toolbar .form-select,
    .result-controls-group .form-select,
    .result-controls-select-sm,
    .result-controls-select-xs {
        width: 100% !important;
    }

    .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 12px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .nav-link {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .card-header {
        padding: 14px 16px;
    }

    .card-body {
        padding: 18px;
    }

    .analysis-period-range {
        flex-direction: column;
        align-items: stretch;
    }

    .analysis-period-group {
        width: 100%;
    }

    .analysis-period-range .fw-bold.text-muted {
        align-self: center;
        margin: 0 !important;
    }

    .result-controls-toolbar label,
    .result-controls-group label {
        width: 100%;
        margin-right: 0 !important;
    }

    .mobile-card-table-wrapper {
        overflow: visible;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table tbody tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 12px 14px;
        margin-bottom: 12px;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    }

    .mobile-card-table tbody td {
        border: 0;
        padding: 0.45rem 0;
        text-align: left !important;
    }

    .mobile-card-table tbody td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.2rem;
        font-size: 0.74rem;
        font-weight: 700;
        color: #6b7280;
    }

    .mobile-card-table tbody td[data-label="선택"] {
        padding-top: 0;
    }

    .mobile-card-table tbody td:last-child {
        padding-bottom: 0;
    }

    #strategy-table .btn {
        width: 100%;
    }
}
