/**
 * Jeety CRM - Advanced Components
 * Composants avancés extraits des maquettes HTML décodées
 */

/* ============================================================
   PROGRESS STEPS - Multi-stage workflow indicators
   ============================================================ */

.progress-steps {
    min-width: 130px;
}

.progress-stage {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.progress-stage.before-work {
    background: rgba(0, 61, 122, 0.1);
    color: var(--primary-color);
}

.progress-stage.after-work {
    background: rgba(230, 0, 126, 0.1);
    color: var(--secondary-color);
}

.progress-stage.paiement {
    background: rgba(0, 150, 94, 0.1);
    color: #00965E;
}

.progress-steps-bar {
    height: 4px;
    background: #f1f3f5;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-steps-bar.before-work .progress-fill {
    background: linear-gradient(90deg, var(--primary-color) 0%, #0052A3 100%);
}

.progress-steps-bar.after-work .progress-fill {
    background: linear-gradient(90deg, var(--secondary-color) 0%, #FF2D9C 100%);
}

.progress-steps-bar.paiement .progress-fill {
    background: linear-gradient(90deg, #00965E 0%, #00C48C 100%);
}

.progress-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-steps-labels {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.progress-step-label {
    font-size: 7px;
    font-weight: 600;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.progress-step-label.active {
    color: var(--primary-color);
    font-weight: 700;
}

.progress-step-label.completed {
    color: #00965E;
}


/* ============================================================
   STEPPER - Workflow horizontal avec numérotation
   ============================================================ */

.stepper {
    margin-bottom: 16px;
    background: white;
    border-radius: 16px;
    padding: 12px 28px;
    box-shadow: var(--shadow-sm);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.progress-bar-track {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #0052A3 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 61, 122, 0.3);
}

.step-text {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.step-label {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.step-label:last-child {
    margin-right: 0;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-label.active .step-dot {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0052A3 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 61, 122, 0.3);
}

.step-label.inactive .step-dot {
    background: #f1f3f5;
    color: #adb5bd;
}

.step-label.completed .step-dot {
    background: linear-gradient(135deg, #00965E 0%, #00C48C 100%);
    color: white;
}

.step-number {
    font-size: 14px;
    font-weight: 700;
}

.step-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
}

.step-label.active .step-title {
    color: var(--primary-color);
    font-weight: 700;
}

.step-label.completed .step-title {
    color: #00965E;
}

.step-label.inactive .step-title {
    color: #adb5bd;
}


/* ============================================================
   STATUS BADGES - Variantes enrichies
   ============================================================ */

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
}

/* Variantes status spécifiques CEE */
.status-badge.corriger {
    background: rgba(204, 0, 34, 0.08);
    color: #CC0022;
}

.status-badge.attente {
    background: rgba(255, 164, 89, 0.08);
    color: #CC6F00;
}

.status-badge.valide {
    background: rgba(0, 150, 94, 0.08);
    color: #00965E;
}

.status-badge.succes {
    background: rgba(0, 196, 140, 0.08);
    color: #00965E;
}

.status-badge.brouillon {
    background: rgba(108, 117, 125, 0.08);
    color: #495057;
}

.status-badge.en-cours {
    background: rgba(0, 61, 122, 0.08);
    color: var(--primary-color);
}

.status-badge.refuse {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

.status-badge.paiement-recu {
    background: rgba(40, 167, 69, 0.08);
    color: #28a745;
}


/* ============================================================
   TABS - System d'onglets
   ============================================================ */

.tabs-container {
    margin-bottom: var(--spacing-lg);
}

.tabs-nav {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: var(--spacing-md);
}

.tab-item {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
}

.tab-item:hover {
    color: var(--primary-color);
    background: rgba(0, 61, 122, 0.03);
}

.tab-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   FILE UPLOAD / DROPZONE
   ============================================================ */

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: var(--spacing-xl);
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 61, 122, 0.03);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.upload-text {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: var(--spacing-sm);
}

.upload-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.upload-hint {
    font-size: 12px;
    color: #adb5bd;
}

.file-input {
    display: none;
}

.uploaded-files {
    margin-top: var(--spacing-md);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
}

.file-icon {
    font-size: 20px;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
}

.file-size {
    font-size: 11px;
    color: #6c757d;
}

.file-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.file-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.file-action-btn:hover {
    background: #e9ecef;
}

.file-action-btn.delete:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}


/* ============================================================
   FILTERS BAR - Barre de filtres avancée
   ============================================================ */

.filters-bar {
    background: white;
    padding: var(--spacing-md);
    border-radius: 12px;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.filters-row {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 6px;
    display: block;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

.filter-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: 22px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn.primary {
    background: var(--primary-color);
    color: white;
}

.filter-btn.primary:hover {
    background: #002d5c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 61, 122, 0.3);
}

.filter-btn.secondary {
    background: #f8f9fa;
    color: #6c757d;
}

.filter-btn.secondary:hover {
    background: #e9ecef;
}


/* ============================================================
   BULK ACTIONS BAR - Actions groupées
   ============================================================ */

.bulk-actions-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bulk-actions-bar.active {
    transform: translateX(-50%) translateY(0);
}

.bulk-selection-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

.bulk-actions-list {
    display: flex;
    gap: var(--spacing-sm);
}

.bulk-action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-action-btn.validate {
    background: rgba(0, 150, 94, 0.1);
    color: #00965E;
}

.bulk-action-btn.validate:hover {
    background: #00965E;
    color: white;
}

.bulk-action-btn.export {
    background: rgba(0, 61, 122, 0.1);
    color: var(--primary-color);
}

.bulk-action-btn.export:hover {
    background: var(--primary-color);
    color: white;
}

.bulk-action-btn.delete {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.bulk-action-btn.delete:hover {
    background: #dc3545;
    color: white;
}


/* ============================================================
   CHAT / AI ASSISTANT BUTTON
   ============================================================ */

.chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 61, 122, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 61, 122, 0.4);
}

.chat-button-icon {
    position: relative;
    font-size: 18px;
}

.chat-button-sparkle {
    position: absolute;
    animation: sparkle 2s infinite;
}

.chat-button-sparkle:nth-child(1) { animation-delay: 0s; }
.chat-button-sparkle:nth-child(2) { animation-delay: 0.6s; }
.chat-button-sparkle:nth-child(3) { animation-delay: 1.2s; }

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}


/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .stepper {
        padding: 12px 16px;
    }
    
    .step-text {
        flex-direction: column;
        gap: 12px;
    }
    
    .step-title {
        display: none;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-actions {
        margin-top: 0;
        width: 100%;
    }
    
    .filter-btn {
        flex: 1;
    }
    
    .bulk-actions-bar {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: translateX(0) translateY(100px);
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bulk-actions-bar.active {
        transform: translateX(0) translateY(0);
    }
    
    .progress-steps {
        min-width: 100px;
    }
    
    .progress-step-label {
        font-size: 6px;
    }
    
    .chat-button {
        bottom: 16px;
        right: 16px;
        padding: 12px 18px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .step-dot {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .progress-bar-container {
        gap: 8px;
    }
    
    .tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-item {
        padding: 10px 16px;
        font-size: 13px;
    }
}
