:root {
    --chart-size: 260px;
}

#myChart,
#myChart2, #myChart3 {
max-width: var(--chart-size);
max-height: var(--chart-size);
}


/* Stats Grid */

.trend-rank {
    background: rgb(211, 225, 251);
    color: #2269eb;
    font-weight: 600;
    border-radius: 4px;
    min-width: 16px;
    text-align: center;
    line-height: 16px;
    height: 16px;
    font-size: 14px;
}

.trend-rank2 {
    font-weight: 600;
    font-style: italic;
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    flex: 1 1 200px;
    min-width: 250px;
    overflow: hidden;
    max-height: 260px;
}


.stat-content {
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.stat-label:hover {
    text-decoration: underline;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;        /* 한 줄로 */
    overflow: hidden;           /* 넘치는 부분 숨기기 */
    text-overflow: ellipsis;    /* ... 표시 */
    min-width: 0;               /* flexbox 안에서 꼭 필요 */
}

.thumbnail {
    width: 100%;       /* 원하는 부모 크기 설정 */
    height: 180px;     /* 원하는 부모 높이 설정 */
    overflow: hidden;
}

.subject {
    font-size: 20px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stat-icon {
    font-size: 2rem;
}

.stat-icon.red { color: #ef4444; }
.stat-icon.blue { color: #3b82f6; }
.stat-icon.green { color: #10b981; }
.stat-icon.orange { color: #f59e0b; }

.rank-box {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    /* background-color: aliceblue; */
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.rank-title {
    font-weight: 700;
    padding: 20px 0 0 20px;
    font-size: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Video Grid */
.video-grid {
    display: flex;
    gap: 1.5rem;
    padding: 20px;
    overflow-x: auto;
    white-space: nowrap;
}

.video-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s;
    width: 120px;
    min-width: 120px;
}

.card-video {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.2s;
    width: 200px;
    min-width: 200px;
}

.video-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.thumbnail-video {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.rank {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #64748b;
    color: white;
    padding: 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.growth {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.video-content {
    padding: 10px;
}

.video-title {
    font-size: 0.875rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.separator {
    height: 1px;
    background: #e2e8f0;
    margin: 0.75rem 0;
}

.badge-outline {
    border: 1px solid #d1d5db;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
   
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .video-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .video-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}