/* Channel Analytics Styles */

/* Analytics Button */
.btn-analytics {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-analytics:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

/* Modal Shared Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    overflow: auto;
}

.modal-content {
    background: #fff;
    margin: 3% auto;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-modal:hover {
    color: #ffeb3b;
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px 30px;
}

/* Stats Grid */
.ch-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.ch-stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: transform 0.2s;
}

.ch-stat-card:hover {
    transform: translateY(-3px);
}

.ch-stat-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.ch-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Segoe UI', monospace;
}

.ch-stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.ch-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ch-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

/* Trend Summary Bar */
.ch-summary-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.trend-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.trend-up {
    background: #d4edda;
    color: #155724;
}

.trend-down {
    background: #f8d7da;
    color: #721c24;
}

.trend-neutral {
    background: #e2e3e5;
    color: #383d41;
}

/* Video Type Tabs */
.video-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.video-tab {
    padding: 8px 18px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    color: #666;
}

.video-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.video-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Top Videos */
.top-videos-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-video-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.2s;
}

.top-video-item:hover {
    background: #e9ecef;
}

.top-video-rank {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    min-width: 35px;
    text-align: center;
}

.top-video-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.top-video-info {
    flex: 1;
    min-width: 0;
}

.top-video-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-video-stats {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.top-video-link {
    font-size: 18px;
    color: #667eea;
    text-decoration: none;
    padding: 5px;
    transition: transform 0.2s;
}

.top-video-link:hover {
    transform: scale(1.2);
}

.empty-text,
.error-text {
    text-align: center;
    padding: 30px;
    color: #999;
}

.error-text {
    color: #e74c3c;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .ch-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .top-video-thumb {
        display: none;
    }

    .modal-body {
        padding: 15px;
    }

    .ch-summary-bar {
        flex-direction: column;
    }
}