/* ═══════════════════════════════════════════════════════════════
   OpusWebcam V4.5 - Module Analytics - Design Moderne
   Fichier: analytics.css
   Description: Styles glassmorphism pour les graphiques et analytics
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   HEADER MODERNE
   ─────────────────────────────────────────────────────────────── */
.stats-header.modern-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 25px !important;
    margin-bottom: 25px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
}

.stats-header .header-title h4 {
    margin: 0 !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    letter-spacing: -0.02em !important;
}

.stats-header .header-subtitle {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-top: 4px !important;
    display: block !important;
}

.stats-header .header-actions {
    display: flex !important;
    gap: 12px !important;
}

/* Boutons modernes */
.btn-modern {
    padding: 10px 20px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.btn-modern.btn-outline {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.btn-modern.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
}

.btn-modern.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    color: #fff !important;
}

.btn-modern.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4) !important;
}

/* ───────────────────────────────────────────────────────────────
   KPI CARDS MODERNES
   ─────────────────────────────────────────────────────────────── */
.stats-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 25px !important;
}

@media (max-width: 1200px) {
    .stats-kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .stats-kpi-grid {
        grid-template-columns: 1fr !important;
    }
}

.kpi-card-modern {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    padding: 20px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.kpi-card-modern::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 4px !important;
    height: 100% !important;
    border-radius: 4px 0 0 4px !important;
}

.kpi-card-modern.gradient-purple::before {
    background: linear-gradient(180deg, #667eea, #764ba2) !important;
}

.kpi-card-modern.gradient-green::before {
    background: linear-gradient(180deg, #43e97b, #38f9d7) !important;
}

.kpi-card-modern.gradient-blue::before {
    background: linear-gradient(180deg, #4facfe, #00f2fe) !important;
}

.kpi-card-modern.gradient-gold::before {
    background: linear-gradient(180deg, #f6d365, #fda085) !important;
}

.kpi-card-modern:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.kpi-card-modern .kpi-icon {
    font-size: 2rem !important;
    opacity: 0.9 !important;
}

.kpi-card-modern .kpi-content {
    flex: 1 !important;
}

.kpi-card-modern .kpi-value {
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    color: #fff !important;
    line-height: 1.2 !important;
}

.kpi-card-modern .kpi-label {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500 !important;
    margin-top: 2px !important;
}

.kpi-card-modern .kpi-sub {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
    margin-top: 4px !important;
}

/* ───────────────────────────────────────────────────────────────
   GRILLE DE GRAPHIQUES MODERNE
   ─────────────────────────────────────────────────────────────── */
.charts-grid-modern {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
}

@media (max-width: 992px) {
    .charts-grid-modern {
        grid-template-columns: 1fr !important;
    }
}

.chart-card-modern {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

.chart-card-modern:hover {
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
}

.chart-card-modern.full-width {
    grid-column: 1 / -1 !important;
}

.chart-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 18px 22px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(255, 255, 255, 0.02) !important;
}

.chart-card-header h5 {
    margin: 0 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #fff !important;
}

.chart-card-header .header-controls {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.btn-icon {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 0.9rem !important;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: rotate(180deg) !important;
}

.select-modern {
    padding: 8px 12px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    outline: none !important;
}

.select-modern:focus {
    border-color: rgba(102, 126, 234, 0.5) !important;
}

.select-modern option {
    background: #1a1f3a !important;
    color: #fff !important;
}

.chart-card-body {
    padding: 22px !important;
}

.chart-container-modern {
    position: relative !important;
    width: 100% !important;
    height: 300px !important;
}

/* ───────────────────────────────────────────────────────────────
   SECTION TITLES
   ─────────────────────────────────────────────────────────────── */
.section-title {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-bottom: 15px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ───────────────────────────────────────────────────────────────
   PROGRESS LIST MODERNE
   ─────────────────────────────────────────────────────────────── */
.progress-list-modern {
    max-height: 320px !important;
    overflow-y: auto !important;
}

.progress-list-modern::-webkit-scrollbar {
    width: 6px !important;
}

.progress-list-modern::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 3px !important;
}

.progress-list-modern::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 3px !important;
}

.progress-list-item,
.progress-list-modern .progress-item {
    display: flex !important;
    align-items: center !important;
    padding: 12px !important;
    margin-bottom: 8px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}

.progress-list-item:hover,
.progress-list-modern .progress-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    transform: translateX(4px) !important;
}

.set-logo {
    width: 36px !important;
    height: 36px !important;
    object-fit: contain !important;
    margin-right: 12px !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.set-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.set-name {
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.set-stats {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.progress-wrapper {
    width: 80px !important;
    margin: 0 12px !important;
}

.progress-wrapper .progress {
    height: 6px !important;
    border-radius: 3px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    overflow: hidden !important;
}

.progress-wrapper .progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2) !important;
    border-radius: 3px !important;
}

.progress-value {
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    color: #667eea !important;
    min-width: 45px !important;
    text-align: right !important;
}

/* ───────────────────────────────────────────────────────────────
   TOP CARDS LIST MODERNE
   ─────────────────────────────────────────────────────────────── */
.top-cards-list-modern {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    max-height: 350px !important;
    overflow-y: auto !important;
}

.top-cards-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.top-card-item {
    display: flex !important;
    align-items: center !important;
    padding: 12px 15px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    transition: all 0.2s ease !important;
}

.top-card-item:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    transform: translateX(4px) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.top-rank {
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    min-width: 35px !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

.top-card-item:nth-child(1) .top-rank { color: #ffd700 !important; }
.top-card-item:nth-child(2) .top-rank { color: #c0c0c0 !important; }
.top-card-item:nth-child(3) .top-rank { color: #cd7f32 !important; }

.top-card-img {
    width: 40px !important;
    height: 56px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    margin-right: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.top-card-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.top-card-name {
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.top-card-set {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.top-card-value {
    font-weight: 700 !important;
    font-size: 1rem !important;
    color: #43e97b !important;
    white-space: nowrap !important;
}

/* ───────────────────────────────────────────────────────────────
   VALUE KPI ROW
   ─────────────────────────────────────────────────────────────── */
.value-kpi-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
}

@media (max-width: 768px) {
    .value-kpi-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.value-kpi {
    text-align: center !important;
    padding: 15px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.value-kpi-value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #fff !important;
}

.value-kpi-label {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-top: 4px !important;
}

/* ───────────────────────────────────────────────────────────────
   MOVERS SECTION
   ─────────────────────────────────────────────────────────────── */
.movers-section {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

@media (max-width: 768px) {
    .movers-section {
        grid-template-columns: 1fr !important;
    }
}

.movers-column {
    display: flex !important;
    flex-direction: column !important;
}

.movers-title {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-bottom: 12px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
}

.movers-title.positive {
    color: #43e97b !important;
    background: rgba(67, 233, 123, 0.1) !important;
}

.movers-title.negative {
    color: #f5576c !important;
    background: rgba(245, 87, 108, 0.1) !important;
}

.movers-list-modern {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.mover-item {
    display: flex !important;
    align-items: center !important;
    padding: 10px 12px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.mover-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

.mover-item .card-thumb {
    width: 32px !important;
    height: 45px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    margin-right: 10px !important;
}

.mover-item .card-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.mover-item .card-name {
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.mover-item .card-set {
    font-size: 0.7rem !important;
    color: rgba(255, 255, 255, 0.4) !important;
}

.mover-change {
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
}

.mover-change.positive {
    color: #43e97b !important;
    background: rgba(67, 233, 123, 0.15) !important;
}

.mover-change.negative {
    color: #f5576c !important;
    background: rgba(245, 87, 108, 0.15) !important;
}

/* ───────────────────────────────────────────────────────────────
   LOADING & EMPTY STATES
   ─────────────────────────────────────────────────────────────── */
.loading-placeholder {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 0.9rem !important;
}

.loading-placeholder::before {
    content: '' !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-top-color: #667eea !important;
    border-radius: 50% !important;
    margin-right: 10px !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ───────────────────────────────────────────────────────────────
   CHART.JS OVERRIDES
   ─────────────────────────────────────────────────────────────── */
canvas {
    max-width: 100% !important;
}
