/* Dashboard 전용 스타일 */

/* 대시보드 헤더 */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 0;
}

.dashboard-header h1 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dashboard-header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* 메트릭 카드들 */
.metric-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #45a049);
}

.metric-card-success::before {
    background: linear-gradient(90deg, #4CAF50, #45a049);
}

.metric-card-primary::before {
    background: linear-gradient(90deg, #2196F3, #1976D2);
}

.metric-card-danger::before {
    background: linear-gradient(90deg, #f44336, #d32f2f);
}

.metric-card-warning::before {
    background: linear-gradient(90deg, #ff9800, #f57c00);
}

.metric-card .card-body {
    padding: 2rem 1.5rem;
}

.metric-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #333, #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.metric-card p {
    color: #666;
    font-weight: 500;
    margin: 0;
}

/* 대시보드 카드들 */
.dashboard-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dashboard-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.dashboard-card .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 1.25rem 1.5rem;
    border-radius: 15px 15px 0 0 !important;
}

.dashboard-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    color: #495057;
}

.dashboard-card .card-body {
    padding: 1.5rem;
}

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

/* 로딩 스피너 개선 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 테이블 스타일 개선 */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: none;
    color: #495057;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
}

.table td {
    border: none;
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    font-size: 0.85rem;
}

.table tbody tr {
    border-bottom: 1px solid #f8f9fa;
}

/* 테이블 내 링크 스타일 */
.table td a {
    color: #495057;
    font-weight: 500;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.table td a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* 최근 분배 ETF 테이블 전용 스타일 */
#recent-distributions-table td {
    padding: 0.5rem 0.3rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

#recent-distributions-table th {
    padding: 0.5rem 0.3rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* 최근 분배 ETF 테이블의 ETF명 링크 - 생략하지 않음 */
#recent-distributions-table td a {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
    word-break: keep-all;
    line-height: 1.2;
}

/* 분배금액 컬럼 - 더 작은 폰트 */
#recent-distributions-table th:nth-child(3),
#recent-distributions-table td:nth-child(3) {
    font-size: 0.7rem;
}

/* 분배일 컬럼 - 더 작은 폰트와 고정 너비 */
#recent-distributions-table th:nth-child(2),
#recent-distributions-table td:nth-child(2) {
    font-size: 0.7rem;
    min-width: 80px;
}

/* 배지 스타일 개선 */
.badge {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
}

/* Top ETF 카드 스타일 */
.etf-item {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border-left: 4px solid #28a745;
}

.etf-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.etf-item h6 {
    color: #343a40;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.etf-item .text-muted {
    font-size: 0.875rem;
}

.etf-item .badge {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* 반응형 개선 */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem 0;
        text-align: center;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .metric-card h3 {
        font-size: 2rem;
    }

    .metric-card .card-body {
        padding: 1.5rem 1rem;
    }

    .dashboard-card .card-body {
        padding: 1rem;
    }

    .chart-container {
        height: 250px;
    }
}

/* 애니메이션 효과 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card {
    animation: fadeInUp 0.6s ease forwards;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }
.metric-card:nth-child(4) { animation-delay: 0.4s; }

/* 차트 텍스트 기반 대체 스타일 */
.chart-fallback {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 10px;
    padding: 1.5rem;
}

.chart-fallback h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-fallback-item {
    background: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.chart-fallback-item:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chart-fallback-item .fw-bold {
    color: #343a40;
}
