/**
 * Imagilire Libre - Module Indicateur de Progression
 * 
 * Styles pour l'indicateur de progression de syllabation en temps réel
 * Optimisé pour mobile (iOS et Android)
 * 
 * @version 1.0.0
 * @author Philippe Ruaudel
 */

/* ============================================
   CONTENEUR PRINCIPAL DE L'INDICATEUR
   ============================================ */

.syllabification-progress-indicator {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 8px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 40px;
    opacity: 0;
    transform: translateY(-5px);
    pointer-events: none;
}

/* Indicateur visible */
.syllabification-progress-indicator.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Indicateur en mode compact (mobile) */
@media (max-width: 600px) {
    .syllabification-progress-indicator {
        padding: 6px 10px;
        font-size: 13px;
        min-height: 36px;
    }
}

/* ============================================
   ÉTATS DE L'INDICATEUR
   ============================================ */

/* État: En cours */
.syllabification-progress-indicator.processing {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 3px solid #2196f3;
}

/* État: Succès */
.syllabification-progress-indicator.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 3px solid #4caf50;
}

/* État: En attente (idle) */
.syllabification-progress-indicator.idle {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 3px solid #9e9e9e;
}

/* ============================================
   BADGE DE STATUT
   ============================================ */

.progress-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Badge en cours */
.progress-status-badge.processing {
    background-color: #2196f3;
    color: white;
}

/* Badge succès */
.progress-status-badge.success {
    background-color: #4caf50;
    color: white;
}

/* Badge idle */
.progress-status-badge.idle {
    background-color: #9e9e9e;
    color: white;
}

/* Icône du badge */
.progress-status-badge .status-icon {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
}

/* Animation de l'icône en cours */
.progress-status-badge.processing .status-icon {
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

/* ============================================
   COMPTEUR DE MOTS
   ============================================ */

.progress-word-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #546e7a;
    font-weight: 500;
}

.progress-word-count .count-number {
    font-weight: 700;
    color: #37474f;
    font-size: 14px;
}

.progress-word-count .count-icon {
    font-size: 14px;
    opacity: 0.7;
}

/* ============================================
   BARRE DE PROGRESSION (subtile)
   ============================================ */

.progress-bar-subtle {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #2196f3, #42a5f5);
    border-radius: 0 0 8px 8px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.syllabification-progress-indicator.processing .progress-bar-subtle {
    opacity: 1;
    animation: progress-shimmer 1.5s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   ANIMATION D'ENTRÉE/SORTIE
   ============================================ */

/* Animation de glissement fluide */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ============================================
   CONTENEUR POUR ÉVITER LES SAUTS VISUELS
   ============================================ */

.progress-indicator-wrapper {
    min-height: 40px;
    transition: min-height 0.2s ease;
    overflow: hidden;
}

/* Sur mobile, réduire la hauteur minimale */
@media (max-width: 600px) {
    .progress-indicator-wrapper {
        min-height: 36px;
    }
}

/* Lorsqu'il n'y a pas d'indicateur */
.progress-indicator-wrapper:empty {
    min-height: 0;
    margin: 0;
}

/* ============================================
   ACCESSIBILITÉ ET ANIMATIONS
   ============================================ */

/* Respecter les préférences utilisateur pour les animations */
@media (prefers-reduced-motion: reduce) {
    .syllabification-progress-indicator,
    .progress-status-badge,
    .progress-bar-subtle {
        animation: none !important;
        transition: none !important;
    }
    
    .syllabification-progress-indicator.visible {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   THÈME SOMBRE (optionnel)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .syllabification-progress-indicator {
        background: linear-gradient(135deg, #2c2c2c 0%, #1e1e1e 100%);
        color: #e0e0e0;
    }
    
    .syllabification-progress-indicator.processing {
        background: linear-gradient(135deg, #1a3a52 0%, #0d2438 100%);
    }
    
    .syllabification-progress-indicator.success {
        background: linear-gradient(135deg, #1b4d20 0%, #0f2912 100%);
    }
    
    .progress-word-count {
        color: #b0bec5;
    }
    
    .progress-word-count .count-number {
        color: #eceff1;
    }
}

/* ============================================
   OPTIMISATIONS MOBILE
   ============================================ */

/* Éviter les problèmes de tap sur iOS */
.syllabification-progress-indicator {
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

/* Utiliser hardware acceleration pour des animations fluides */
.syllabification-progress-indicator,
.progress-status-badge,
.progress-bar-subtle {
    will-change: transform, opacity;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ============================================
   VARIATIONS DE TAILLE DE POLICE
   ============================================ */

.font-size-small .syllabification-progress-indicator {
    font-size: 12px;
    min-height: 36px;
}

.font-size-small .progress-status-badge {
    font-size: 11px;
    padding: 3px 8px;
}

.font-size-large .syllabification-progress-indicator {
    font-size: 15px;
    min-height: 44px;
}

.font-size-large .progress-status-badge {
    font-size: 14px;
    padding: 5px 12px;
}

.font-size-xlarge .syllabification-progress-indicator {
    font-size: 16px;
    min-height: 48px;
}

.font-size-xlarge .progress-status-badge {
    font-size: 15px;
    padding: 6px 14px;
}
