/**
 * AFF - Feuille de Route (Roadmap) Styles
 * Design timeline engageant pour l'accompagnement
 */

/* ========================================
   ROADMAP CONTAINER
   ======================================== */
.aff-roadmap {
    max-width: 800px;
    margin: 0 auto;
}

.aff-roadmap-header {
    margin-bottom: var(--aff-space-xl);
}

.aff-roadmap-title {
    font-size: var(--aff-font-size-2xl);
    font-weight: var(--aff-font-weight-bold);
    color: var(--aff-gray-900);
    margin: 0 0 var(--aff-space-sm) 0;
}

.aff-roadmap-objective {
    color: var(--aff-gray-600);
    font-size: var(--aff-font-size-base);
    line-height: var(--aff-line-height-relaxed);
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.aff-roadmap-progress {
    margin-bottom: var(--aff-space-xl);
}

.aff-progress-bar {
    height: 12px;
    background: var(--aff-gray-100);
    border-radius: var(--aff-radius-full);
    overflow: hidden;
    position: relative;
}

.aff-progress-fill {
    height: 100%;
    background: var(--aff-gradient-warm);
    border-radius: var(--aff-radius-full);
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.aff-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.aff-progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: var(--aff-space-sm);
    font-size: var(--aff-font-size-sm);
    color: var(--aff-gray-600);
}

.aff-progress-percentage {
    font-weight: var(--aff-font-weight-bold);
    color: var(--aff-primary);
}

/* ========================================
   TIMELINE
   ======================================== */
.aff-timeline {
    position: relative;
    padding-left: 30px;
}

.aff-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--aff-gray-200);
}

.aff-timeline-item {
    position: relative;
    padding-bottom: var(--aff-space-xl);
}

.aff-timeline-item:last-child {
    padding-bottom: 0;
}

/* Dot indicator */
.aff-timeline-dot {
    position: absolute;
    left: -30px;
    top: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
    background: var(--aff-white);
    border: 2px solid var(--aff-gray-200);
}

.aff-timeline-item--a_venir .aff-timeline-dot {
    background: var(--aff-white);
    border-color: var(--aff-gray-300);
}

.aff-timeline-item--en_cours .aff-timeline-dot {
    background: var(--aff-info);
    border-color: var(--aff-info);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
    }
}

.aff-timeline-item--termine .aff-timeline-dot {
    background: var(--aff-success);
    border-color: var(--aff-success);
}

.aff-timeline-item--pause .aff-timeline-dot {
    background: var(--aff-warning);
    border-color: var(--aff-warning);
}

/* Current step indicator */
.aff-timeline-item--current::before {
    content: '← VOUS ÊTES ICI';
    position: absolute;
    left: -160px;
    top: 4px;
    font-size: var(--aff-font-size-xs);
    font-weight: var(--aff-font-weight-bold);
    color: var(--aff-info);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .aff-timeline-item--current::before {
        display: none;
    }
}

/* Line color variation */
.aff-timeline-item--termine+.aff-timeline-item::after {
    content: '';
    position: absolute;
    left: -19px;
    top: -24px;
    bottom: 24px;
    width: 2px;
    background: var(--aff-success);
    z-index: 1;
}

/* ========================================
   STEP CARD
   ======================================== */
.aff-step-card {
    background: var(--aff-white);
    border-radius: var(--aff-radius-lg);
    padding: var(--aff-space-lg);
    border: 2px solid var(--aff-gray-100);
    transition: all var(--aff-transition-base);
    position: relative;
}

.aff-step-card:hover {
    border-color: rgba(240, 103, 53, 0.2);
    box-shadow: var(--aff-shadow-md);
}

.aff-timeline-item--en_cours .aff-step-card {
    border-color: var(--aff-info);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.aff-timeline-item--termine .aff-step-card {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Modified by user badge */
.aff-step-modified-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--aff-warning);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: pulse-warning 1.5s infinite;
    cursor: pointer;
}

@keyframes pulse-warning {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.aff-step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--aff-space-md);
    margin-bottom: var(--aff-space-sm);
}

.aff-step-title {
    font-size: var(--aff-font-size-lg);
    font-weight: var(--aff-font-weight-semibold);
    color: var(--aff-gray-900);
    margin: 0;
}

.aff-step-date {
    font-size: var(--aff-font-size-sm);
    color: var(--aff-gray-500);
    white-space: nowrap;
}

.aff-step-objective {
    color: var(--aff-gray-600);
    font-size: var(--aff-font-size-sm);
    line-height: var(--aff-line-height-relaxed);
    margin-bottom: var(--aff-space-md);
}

/* ========================================
   STEP TOOLS
   ======================================== */
.aff-step-tools {
    margin-top: var(--aff-space-md);
    padding-top: var(--aff-space-md);
    border-top: 1px dashed var(--aff-gray-200);
}

.aff-step-tool-item {
    display: flex;
    align-items: center;
    gap: var(--aff-space-sm);
    padding: var(--aff-space-sm) var(--aff-space-md);
    background: rgba(59, 130, 246, 0.08);
    border-radius: var(--aff-radius-md);
    margin-bottom: var(--aff-space-xs);
    font-size: var(--aff-font-size-sm);
    color: var(--aff-info);
    text-decoration: none;
    transition: all var(--aff-transition-fast);
}

.aff-step-tool-item:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: translateX(4px);
}

.aff-step-tool-item::before {
    content: '📎';
}

/* ========================================
   STEP COMMENTS
   ======================================== */
.aff-step-comments {
    margin-top: var(--aff-space-md);
}

.aff-step-comment {
    display: flex;
    gap: var(--aff-space-sm);
    padding: var(--aff-space-sm);
    background: rgba(240, 103, 53, 0.05);
    border-radius: var(--aff-radius-md);
    margin-bottom: var(--aff-space-xs);
    font-size: var(--aff-font-size-sm);
}

.aff-step-comment-icon {
    flex-shrink: 0;
}

.aff-step-comment-content {
    flex: 1;
}

.aff-step-comment-author {
    font-weight: var(--aff-font-weight-semibold);
    color: var(--aff-primary);
}

.aff-step-comment-text {
    color: var(--aff-gray-700);
}

/* ========================================
   STEP ACTIONS
   ======================================== */
.aff-step-actions {
    display: flex;
    gap: var(--aff-space-sm);
    margin-top: var(--aff-space-md);
    flex-wrap: wrap;
}

.aff-step-btn-complete {
    flex: 1;
    min-width: 150px;
}

/* ========================================
   CELEBRATION ANIMATION
   ======================================== */
.aff-celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    text-align: center;
    background: var(--aff-white);
    padding: var(--aff-space-2xl);
    border-radius: var(--aff-radius-2xl);
    box-shadow: var(--aff-shadow-xl);
    animation: celebrationPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebrationPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.aff-celebration-icon {
    font-size: 64px;
    margin-bottom: var(--aff-space-md);
    animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.aff-celebration-title {
    font-size: var(--aff-font-size-xl);
    font-weight: var(--aff-font-weight-bold);
    color: var(--aff-success);
    margin-bottom: var(--aff-space-sm);
}

.aff-celebration-text {
    color: var(--aff-gray-600);
}

.aff-celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

/* ========================================
   NEXT STEP WIDGET
   ======================================== */
.aff-next-step-widget {
    background: var(--aff-gradient-soft);
    border: 2px solid rgba(240, 103, 53, 0.2);
    border-radius: var(--aff-radius-xl);
    padding: var(--aff-space-xl);
    margin-bottom: var(--aff-space-xl);
}

.aff-next-step-label {
    font-size: var(--aff-font-size-sm);
    font-weight: var(--aff-font-weight-semibold);
    color: var(--aff-primary);
    margin-bottom: var(--aff-space-sm);
    display: flex;
    align-items: center;
    gap: var(--aff-space-xs);
}

.aff-next-step-title {
    font-size: var(--aff-font-size-xl);
    font-weight: var(--aff-font-weight-bold);
    color: var(--aff-gray-900);
    margin: 0 0 var(--aff-space-sm) 0;
}

.aff-next-step-date {
    color: var(--aff-gray-600);
    font-size: var(--aff-font-size-sm);
    margin-bottom: var(--aff-space-md);
}

.aff-next-step-actions {
    display: flex;
    gap: var(--aff-space-md);
    flex-wrap: wrap;
}

/* ========================================
   REFERENT CONTROLS
   ======================================== */
.aff-roadmap-controls {
    display: flex;
    gap: var(--aff-space-md);
    margin-bottom: var(--aff-space-xl);
    flex-wrap: wrap;
}

.aff-add-step-form {
    background: var(--aff-gray-50);
    border-radius: var(--aff-radius-lg);
    padding: var(--aff-space-lg);
    margin-top: var(--aff-space-lg);
    display: none;
}

.aff-add-step-form.active {
    display: block;
    animation: aff-fade-in var(--aff-transition-base) ease-out;
}

.aff-template-selector {
    margin-bottom: var(--aff-space-lg);
}

.aff-template-card {
    background: var(--aff-white);
    border: 2px solid var(--aff-gray-200);
    border-radius: var(--aff-radius-lg);
    padding: var(--aff-space-md);
    cursor: pointer;
    transition: all var(--aff-transition-base);
    margin-bottom: var(--aff-space-sm);
}

.aff-template-card:hover {
    border-color: var(--aff-primary);
    box-shadow: var(--aff-shadow-sm);
}

.aff-template-card.selected {
    border-color: var(--aff-primary);
    background: rgba(240, 103, 53, 0.05);
}

.aff-template-title {
    font-weight: var(--aff-font-weight-semibold);
    color: var(--aff-gray-900);
    margin-bottom: var(--aff-space-xs);
}

.aff-template-meta {
    font-size: var(--aff-font-size-xs);
    color: var(--aff-gray-500);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.aff-roadmap-empty {
    text-align: center;
    padding: var(--aff-space-2xl);
}

.aff-roadmap-empty-icon {
    font-size: 48px;
    margin-bottom: var(--aff-space-md);
}

.aff-roadmap-empty-title {
    font-size: var(--aff-font-size-lg);
    font-weight: var(--aff-font-weight-semibold);
    color: var(--aff-gray-700);
    margin-bottom: var(--aff-space-sm);
}

.aff-roadmap-empty-text {
    color: var(--aff-gray-500);
    margin-bottom: var(--aff-space-lg);
}

/* ========================================
   DATE PICKER STYLES
   ======================================== */
.aff-date-input {
    position: relative;
}

.aff-date-input input {
    padding-right: 40px;
}

.aff-date-input::after {
    content: '📅';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .aff-timeline {
        padding-left: 24px;
    }

    .aff-timeline::before {
        left: 9px;
    }

    .aff-timeline-dot {
        left: -24px;
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .aff-step-card {
        padding: var(--aff-space-md);
    }

    .aff-step-header {
        flex-direction: column;
    }

    .aff-roadmap-controls {
        flex-direction: column;
    }

    .aff-next-step-actions {
        flex-direction: column;
    }
}