/**
 * Dashboard Home - Design Premium & Moderne
 * Premier écran vu par les utilisateurs - DESIGN IMPECCABLE
 * Style : Cards glassmorphism, animations fluides, statistiques élégantes
 */

/* =================================================================
   CONTAINER PRINCIPAL
   ================================================================= */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-xl);
    min-height: calc(100vh - 120px);
}

/* =================================================================
   HEADER - Bienvenue personnalisée
   ================================================================= */
.dashboard-header {
    margin-bottom: var(--spacing-2xl);
}

.dashboard-header__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
}

.dashboard-title {
    font-size: 2.25rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-secondary);
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-gray-dark);
    font-weight: var(--font-weight-normal);
}

/* =================================================================
   STATISTICS CARDS - KPIs avec animations
   ================================================================= */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-3xl);
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--border-radius-2xl);
    padding: var(--spacing-2xl);
    border: 1px solid rgba(12, 129, 228, 0.12);
    box-shadow: 0 2px 8px rgba(12, 129, 228, 0.06);
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-main);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(12, 129, 228, 0.15);
    border-color: rgba(12, 129, 228, 0.25);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card__icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover .stat-card__icon {
    transform: scale(1.08) rotate(3deg);
}

.stat-card--primary .stat-card__icon {
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.12), rgba(58, 158, 235, 0.08));
    color: var(--color-primary);
}

.stat-card--success .stat-card__icon {
    background: linear-gradient(135deg, rgba(48, 147, 68, 0.12), rgba(48, 147, 68, 0.08));
    color: var(--color-success);
}

.stat-card--warning .stat-card__icon {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.12), rgba(255, 152, 0, 0.08));
    color: #FF9800;
}

.stat-card--info .stat-card__icon {
    background: linear-gradient(135deg, rgba(41, 98, 255, 0.12), rgba(41, 98, 255, 0.08));
    color: #2962FF;
}

.stat-card__icon svg {
    width: 32px;
    height: 32px;
}

.stat-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-gray-dark);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-card__value {
    font-size: 2.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    font-family: var(--font-secondary);
    line-height: 1;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.stat-card__detail {
    font-size: var(--font-size-sm);
    color: var(--color-gray-dark);
    font-weight: var(--font-weight-semibold);
}

/* Progress bar pour tokens */
.stat-card__progress {
    margin-top: var(--spacing-lg);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, rgba(12, 129, 228, 0.08), rgba(58, 158, 235, 0.08));
    border-radius: var(--border-radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar__fill {
    height: 100%;
    background: var(--gradient-main);
    border-radius: var(--border-radius-full);
    transition: width 800ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(12, 129, 228, 0.4);
}

/* =================================================================
   SECTIONS
   ================================================================= */
.dashboard-section {
    margin-bottom: var(--spacing-3xl);
}

.section-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin-bottom: var(--spacing-xl);
    font-family: var(--font-secondary);
    letter-spacing: -0.01em;
}

/* =================================================================
   QUICK ACTIONS - Accès rapides élégants
   ================================================================= */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-xl);
}

.quick-action {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-2xl);
    background: var(--color-white);
    border: 1px solid rgba(12, 129, 228, 0.12);
    border-radius: var(--border-radius-2xl);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(12, 129, 228, 0.06);
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-action::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(12, 129, 228, 0.15);
    border-color: var(--color-primary);
}

.quick-action:hover::before {
    opacity: 0.02;
}

.quick-action__icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.quick-action:hover .quick-action__icon {
    transform: scale(1.12) rotate(-3deg);
}

.quick-action--primary .quick-action__icon {
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.15), rgba(58, 158, 235, 0.10));
    color: var(--color-primary);
}

.quick-action--secondary .quick-action__icon {
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.15), rgba(58, 158, 235, 0.10));
    color: var(--color-primary);
}

.quick-action--accent .quick-action__icon {
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.15), rgba(58, 158, 235, 0.10));
    color: var(--color-primary);
}

.quick-action__icon svg {
    width: 28px;
    height: 28px;
}

/* Agrandir l'icône SerenIA pour une meilleure visibilité */
.quick-action--accent .quick-action__icon svg {
    width: 36px;
    height: 36px;
}

.quick-action__content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.quick-action__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-secondary);
}

.quick-action__description {
    font-size: var(--font-size-sm);
    color: var(--color-gray-dark);
    line-height: 1.5;
}

.quick-action__arrow {
    color: var(--color-primary);
    opacity: 0;
    transform: translateX(-12px);
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.quick-action:hover .quick-action__arrow {
    opacity: 1;
    transform: translateX(0);
}

/* État désactivé pour accès rapide */
.quick-action--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.quick-action--disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(12, 129, 228, 0.06);
    border-color: rgba(12, 129, 228, 0.12);
}

.quick-action--disabled:hover::before {
    opacity: 0;
}

.quick-action--disabled .quick-action__icon {
    filter: grayscale(100%);
    opacity: 0.7;
}

.quick-action--disabled:hover .quick-action__icon {
    transform: none;
}

.quick-action--disabled .quick-action__arrow {
    opacity: 0.3;
}

/* Badge "À venir" dans les accès rapides */
.quick-action__badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(168, 85, 247, 0.08) 100%);
    color: rgb(147, 51, 234);
    border-radius: var(--border-radius-full);
    border: 1px solid rgba(147, 51, 234, 0.2);
    margin-bottom: var(--spacing-xs);
    width: fit-content;
}

/* =================================================================
   DASHBOARD GRID - Layout 2 colonnes
   ================================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: var(--spacing-xl);
}

/* =================================================================
   DASHBOARD CARDS - Sections guide & activité (Minimal Clean)
   ================================================================= */
.dashboard-card {
    background: var(--color-white);
    border: 1px solid rgba(12, 129, 228, 0.06);
    border-radius: var(--border-radius-2xl);
    overflow: hidden;
    transition: border-color 300ms ease;
}

.dashboard-card:hover {
    border-color: rgba(12, 129, 228, 0.12);
}

.dashboard-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-2xl) var(--spacing-2xl) var(--spacing-lg);
    border-bottom: none;
}

.dashboard-card__header .section-title {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
}

.dashboard-card__body {
    padding: 0 var(--spacing-2xl) var(--spacing-2xl);
}

/* =================================================================
   BADGES
   ================================================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.badge--primary {
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.18), rgba(58, 158, 235, 0.12));
    color: var(--color-primary);
    border: 1px solid rgba(12, 129, 228, 0.25);
}

/* =================================================================
   GUIDE STEPS - Onboarding minimal et épuré
   ================================================================= */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
}

.guide-step {
    display: flex;
    gap: var(--spacing-lg);
    padding: 0;
    transition: opacity 200ms ease;
}

.guide-step:hover {
    opacity: 0.8;
}

.guide-step__icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    background: rgba(12, 129, 228, 0.06);
    color: var(--color-gray);
    border: none;
    transition: all 200ms ease;
}

.guide-step--completed .guide-step__icon {
    background: var(--color-primary);
    color: var(--color-white);
}

.guide-step--active .guide-step__icon {
    background: var(--color-primary);
    color: var(--color-white);
    animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.guide-step__content {
    flex: 1;
    padding-top: 2px;
}

.guide-step__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-black);
    margin-bottom: 6px;
    font-family: var(--font-secondary);
}

.guide-step__description {
    font-size: var(--font-size-sm);
    color: var(--color-gray);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.guide-step__link {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 200ms ease;
}

.guide-step__link:hover {
    color: var(--color-primary-dark);
}

/* =================================================================
   ACTIVITY LIST - Historique récent (Minimal Clean)
   ================================================================= */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: 0;
    transition: opacity 200ms ease;
}

.activity-item:hover {
    opacity: 0.8;
}

.activity-item__icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 129, 228, 0.06);
    color: var(--color-primary);
    transition: background 200ms ease;
}

.activity-item:hover .activity-item__icon {
    background: rgba(12, 129, 228, 0.1);
}

.activity-item__icon svg {
    width: 18px;
    height: 18px;
}

.activity-item__content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.activity-item__title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-black);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: var(--font-secondary);
    line-height: 1.4;
}

.activity-item__meta {
    font-size: var(--font-size-sm);
    color: var(--color-gray-dark);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.activity-item__tokens,
.activity-item__energy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: var(--font-weight-semibold);
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 200ms ease;
}

.activity-item__tokens {
    color: var(--color-primary);
    background: rgba(12, 129, 228, 0.04);
    border: 1px solid rgba(12, 129, 228, 0.12);
}

.activity-item__tokens:hover {
    background: rgba(12, 129, 228, 0.08);
    border-color: rgba(12, 129, 228, 0.2);
}

.activity-item__energy {
    color: #f57c00;
    background: rgba(255, 193, 7, 0.06);
    border: 1px solid rgba(245, 124, 0, 0.15);
}

.activity-item__energy:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(245, 124, 0, 0.25);
}

.activity-item__tokens svg,
.activity-item__energy svg {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}

.activity-item__badge {
    font-size: var(--font-size-xs);
    color: var(--color-white);
    font-weight: var(--font-weight-medium);
    padding: 4px 12px;
    background: var(--color-primary);
    border-radius: var(--border-radius-full);
    white-space: nowrap;
    border: none;
    align-self: flex-start;
}

/* =================================================================
   EMPTY STATE (Minimal Clean)
   ================================================================= */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    text-align: center;
}

.empty-state__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 129, 228, 0.04);
    color: var(--color-gray);
    margin-bottom: var(--spacing-xl);
}

.empty-state__icon svg {
    width: 24px;
    height: 24px;
    opacity: 0.6;
}

.empty-state__text {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-black);
    margin-bottom: 6px;
    font-family: var(--font-secondary);
}

.empty-state__subtext {
    font-size: var(--font-size-sm);
    color: var(--color-gray);
    line-height: 1.5;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .dashboard-header__content {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .dashboard-title {
        font-size: 1.75rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .stat-card {
        padding: var(--spacing-xl);
    }

    .stat-card__value {
        font-size: 2.25rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .dashboard-card__header,
    .dashboard-card__body {
        padding: var(--spacing-xl);
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .dashboard-title {
        font-size: 1.5rem;
    }

    .dashboard-subtitle {
        font-size: var(--font-size-base);
    }

    .stat-card {
        padding: var(--spacing-lg);
    }

    .stat-card__icon {
        width: 52px;
        height: 52px;
    }

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

    .quick-action {
        padding: var(--spacing-lg);
    }

    .dashboard-card__header,
    .dashboard-card__body {
        padding: var(--spacing-lg);
    }

    .activity-item__title {
        font-size: var(--font-size-sm);
    }

    .section-title {
        font-size: 1.25rem;
    }
}
