/**
 * Analytics Dashboard — Cercle C4 Diffusion
 * Styles specifiques : KPI cards, barres tendances, table top titres, activite
 */

/* ===================== KPI Cards ===================== */

.c4-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.c4-kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.c4-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(180,83,9,0.12);
    transform: translateY(-2px);
}

.c4-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.c4-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}

.c4-kpi-label {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 500;
}

/* ===================== Card Common ===================== */

.c4-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.c4-card-header {
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    padding: 1rem 1.25rem;
}

.c4-card-header h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* ===================== Top Titres Table ===================== */

.c4-table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    font-weight: 600;
    border-bottom-width: 1px;
    padding: 0.6rem 0.5rem;
    white-space: nowrap;
}

.c4-table tbody td {
    vertical-align: middle;
    padding: 0.65rem 0.5rem;
    font-size: 0.88rem;
    border-bottom: 1px solid #f9fafb;
}

.c4-table tbody tr:hover {
    background: #fffbeb;
}

.c4-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.c4-badge-score {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.25em 0.55em;
    border-radius: 6px;
}

/* ===================== Tendances Secteur (barres CSS) ===================== */

.c4-genre-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.c4-genre-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.c4-genre-label {
    width: 110px;
    font-size: 0.8rem;
    color: #374151;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.c4-genre-bar-wrap {
    flex: 1;
    background: #f3f4f6;
    border-radius: 6px;
    height: 18px;
    overflow: hidden;
}

.c4-genre-bar {
    height: 100%;
    background: linear-gradient(90deg, #b45309, #f59e0b);
    border-radius: 6px;
    min-width: 4px;
    transition: width 0.5s ease;
}

.c4-genre-count {
    width: 32px;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    flex-shrink: 0;
}

/* ===================== Activite recente ===================== */

.c4-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.c4-activity-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.c4-activity-item:hover {
    background: #fffbeb;
}

.c4-activity-content {
    flex: 1;
    min-width: 0;
}

.c4-activity-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c4-activity-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

.c4-activity-meta .badge {
    font-size: 0.7rem;
    font-weight: 500;
}

.c4-activity-date {
    flex-shrink: 0;
    font-size: 0.76rem;
}

/* ===================== Empty State ===================== */

.c4-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.c4-empty-state p {
    font-size: 0.88rem;
}

/* ===================== Refresh Button ===================== */

#c4-refresh-btn {
    border-color: #d1d5db;
    color: #6b7280;
    font-size: 0.82rem;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    transition: all 0.2s ease;
}

#c4-refresh-btn:hover {
    border-color: #b45309;
    color: #b45309;
    background: rgba(180,83,9,0.04);
}

/* ===================== Responsive ===================== */

@media (max-width: 767.98px) {
    .c4-kpi-card {
        padding: 1rem;
    }

    .c4-kpi-value {
        font-size: 1.35rem;
    }

    .c4-kpi-label {
        font-size: 0.75rem;
    }

    .c4-genre-label {
        width: 80px;
        font-size: 0.72rem;
    }

    .c4-table thead th,
    .c4-table tbody td {
        font-size: 0.78rem;
        padding: 0.5rem 0.35rem;
    }

    .c4-activity-title {
        font-size: 0.82rem;
    }

    .c4-icon-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .c4-kpi-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .c4-kpi-value {
        font-size: 1.15rem;
    }

    .c4-genre-label {
        width: 65px;
    }

    /* Stack activity date below content on very small screens */
    .c4-activity-item {
        flex-wrap: wrap;
    }

    .c4-activity-date {
        width: 100%;
        text-align: right;
        margin-top: -0.25rem;
    }
}
