/* 전체 애플리케이션 스타일 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* 사이드바 스타일 */
.sidebar {
    background-color: #212529;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    min-height: 100vh;
}

.sidebar .nav-link {
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 4px 8px;
    padding: 12px 16px;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* 카드 스타일 */
.card {
    border: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(0,0,0,0.12);
    z-index: 2;
}

.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: 20px;
}

/* 통계 카드 특별 스타일 */
.stats-card {
    text-align: center;
    padding: 25px 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.stats-card h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

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

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    color: #495057;
}

/* 드롭다운 스타일 개선 (z-index 문제 해결) */
.Select-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.Select-control:hover {
    border-color: #667eea;
}

.Select-control.is-focused {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Dash Core Components Dropdown 스타일 */
.dash-dropdown {
    position: relative;
    z-index: 100 !important;
}

.dash-dropdown .Select-menu-outer {
    z-index: 1000 !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    border: 1px solid #e9ecef !important;
    max-height: 200px !important;
    overflow-y: auto !important;
}

.dash-dropdown .Select-menu {
    max-height: 200px !important;
    overflow-y: auto !important;
    border-radius: 8px !important;
}

.dash-dropdown .Select-option {
    padding: 10px 12px !important;
    transition: all 0.2s ease !important;
}

.dash-dropdown .Select-option:hover {
    background-color: #f8f9fa !important;
    color: #495057 !important;
}

.dash-dropdown .Select-option.is-focused {
    background-color: #667eea !important;
    color: white !important;
}

.dash-dropdown .Select-option.is-selected {
    background-color: #667eea !important;
    color: white !important;
    font-weight: 500 !important;
}

/* React Select (새 버전) 스타일 */
.css-26l3qy-menu,
.css-1pahdxg-menu {
    z-index: 1000 !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    border: 1px solid #e9ecef !important;
}

.css-4ljt47-MenuList,
.css-11unzgr {
    max-height: 200px !important;
    overflow-y: auto !important;
}

/* DCC Dropdown 컨테이너 */
.dropdown-container {
    position: relative;
    z-index: 100;
}

/* 특정 페이지의 dropdown들이 카드 위에 표시되도록 */
.investment-analysis .dash-dropdown,
.stock-recommendation .dash-dropdown,
.portfolio .dash-dropdown {
    z-index: 999 !important;
}

.investment-analysis .Select-menu-outer,
.stock-recommendation .Select-menu-outer,
.portfolio .Select-menu-outer {
    z-index: 1001 !important;
}

/* 테이블 스타일 */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px 12px;
}

.table td {
    padding: 12px;
    border-top: 1px solid #f1f3f4;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

/* 배지 스타일 */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 6px 12px;
}

/* 차트 컨테이너 스타일 */
.graph-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

/* 로딩 스피너 스타일 */
._dash-loading {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

._dash-loading-callback {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
}

/* 알림 스타일 */
.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
    margin: 20px 0;
}

.alert-warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #856404;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #a3d977 100%);
    color: #155724;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .card-body {
        padding: 15px;
    }

    .stats-card h2 {
        font-size: 2rem;
    }

    .table-responsive {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .card-header {
        padding: 12px 15px;
    }

    .card-body {
        padding: 12px;
    }

    .btn {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    .stats-card h2 {
        font-size: 1.8rem;
    }

    .stats-card h4 {
        font-size: 1rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* 그라데이션 배경 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-light {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-bg-warning {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* 텍스트 효과 */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 호버 효과 */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* 구분선 스타일 */
hr.custom {
    border: none;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    margin: 30px 0;
}

/* 스크롤바 스타일 (웹킷 브라우저) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 종목 목록 페이지 특별 스타일 */
.stock-rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-weight: bold;
}

.stock-rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    font-weight: bold;
}

.stock-rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    font-weight: bold;
}

/* 필터 슬라이더 스타일 */
.rc-slider-track {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.rc-slider-handle {
    border-color: #667eea;
    background-color: #667eea;
}

.rc-slider-handle:hover {
    border-color: #5a6fd8;
    background-color: #5a6fd8;
}

/* 종목 테이블 특별 효과 */
.stock-table-row {
    transition: all 0.3s ease;
}

.stock-table-row:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 수익률 표시 강화 */
.return-positive-high {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
}

.return-positive {
    color: #28a745;
    font-weight: 600;
}

.return-negative {
    color: #dc3545;
    font-weight: 600;
}

.return-negative-high {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
}

/* 모델 정확도 표시 */
.accuracy-excellent {
    color: #28a745;
    font-weight: bold;
}

.accuracy-good {
    color: #17a2b8;
    font-weight: 600;
}

.accuracy-fair {
    color: #ffc107;
    font-weight: 600;
}

.accuracy-poor {
    color: #dc3545;
    font-weight: 600;
}

/* 반응형 테이블 스타일 개선 */
@media (max-width: 1200px) {
    .table-responsive {
        font-size: 0.9rem;
    }

    .table th, .table td {
        padding: 8px 6px;
    }
}

@media (max-width: 992px) {
    .table-responsive {
        font-size: 0.8rem;
    }

    .table th, .table td {
        padding: 6px 4px;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

/* 필터 패널 스타일 */
.filter-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 요약 통계 카드 특별 스타일 */
.summary-card {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* 로딩 상태 개선 */
.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    border-radius: 8px;
}

/* 툴팁 스타일 */
.custom-tooltip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 탭 스타일 강화 */
.nav-tabs .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
}

.nav-tabs .nav-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
    font-weight: bold !important;
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active:hover {
    background-color: #0b5ed7 !important;
    border-color: #0b5ed7 !important;
}
