/* ===================================
   PROFESSIONAL TIMELINE PROGRESS SYSTEM
   Advanced CSS Architecture
   =================================== */

/* Base Timeline Container */
.process-timeline {
    --timeline-primary: #f5a623;
    --timeline-secondary: #FFD700;
    --timeline-accent: #ff6b6b;
    --timeline-dark: #232937;
    --timeline-light: #3a3f4e;
    --timeline-glow: rgba(245, 166, 35, 0.4);
    --timeline-transition: cubic-bezier(0.4, 0, 0.2, 1);
    
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 0;
}

/* Timeline Track Base */
.timeline-track {
    position: relative;
    padding: 0 40px;
}

/* Timeline Steps Container */
.timeline-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    z-index: 10;
}

/* Connection Line */
.timeline-steps::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50px; /* Начинаем от центра первого круга */
    right: 50px; /* Заканчиваем в центре последнего круга */
    height: 3px;
    background: var(--timeline-light);
    z-index: 1;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Animated Progress Bar */
.timeline-progress {
    position: absolute;
    top: 30px;
    left: 50px; /* Начинаем от центра первого круга */
    right: 50px; /* Ограничиваем справа */
    height: 3px;
    background: linear-gradient(90deg, 
        var(--timeline-primary) 0%, 
        var(--timeline-secondary) 50%,
        var(--timeline-accent) 100%);
    z-index: 5;
    width: 0;
    max-width: calc(100% - 100px); /* Максимальная ширина */
    border-radius: 2px;
    transition: width 0.5s ease;
    box-shadow: 
        0 0 20px var(--timeline-glow),
        0 0 40px rgba(245, 166, 35, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.3);
    transform-origin: left center;
}

/* Progress Bar Animations */
.timeline-progress.animating {
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { 
        box-shadow: 
            0 0 20px var(--timeline-glow),
            0 0 40px rgba(245, 166, 35, 0.2),
            0 2px 4px rgba(0, 0, 0, 0.3);
    }
    50% { 
        box-shadow: 
            0 0 30px var(--timeline-glow),
            0 0 60px rgba(245, 166, 35, 0.3),
            0 2px 6px rgba(0, 0, 0, 0.4);
    }
}

/* Progress Gradient Overlay */
.progress-gradient-overlay {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.3) 50%,
        transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-progress.animating .progress-gradient-overlay {
    opacity: 1;
    animation: shimmerMove 1.5s linear infinite;
}

/* Shimmer Effect */
.progress-shimmer {
    position: absolute;
    top: -10px;
    left: -50px;
    width: 100px;
    height: 23px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    transform: skewX(-20deg);
    opacity: 0;
    pointer-events: none;
}

.progress-shimmer.shimmer-active {
    animation: shimmerSlide 1s ease-out;
}

@keyframes shimmerSlide {
    0% {
        opacity: 0;
        left: -100px;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        left: calc(100% + 100px);
    }
}

/* Timeline Step */
.timeline-step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transition: all 0.4s var(--timeline-transition);
}

/* Step Circle Container */
.step-circle {
    width: 60px;
    height: 60px;
    background: var(--timeline-dark);
    border: 3px solid var(--timeline-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 15;
    transition: all 0.4s var(--timeline-transition);
    cursor: pointer;
    overflow: visible;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.step-circle span {
    font-size: 20px;
    font-weight: 700;
    color: #a0a4b8;
    z-index: 20;
    transition: all 0.3s ease;
    position: relative;
    display: block;
}

/* Progress Ring SVG */
.progress-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 64px;
    height: 64px;
    transform: rotate(-90deg);
    z-index: 25;
    pointer-events: none;
}

.progress-ring-circle {
    stroke: var(--timeline-primary);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s;
    filter: drop-shadow(0 0 5px var(--timeline-glow));
}

/* Убираем сложные анимации пульсации для стабильности */

/* Step Glow Effect */
.step-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle,
        var(--timeline-glow) 0%,
        transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.4s ease;
}

.step-glow.glow-active {
    opacity: 1;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Убираем анимации частиц для стабильности */

/* Completion Checkmark */
.completion-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    font-size: 26px;
    color: white;
    font-weight: bold;
    z-index: 25;
    opacity: 0;
    transition: all 0.4s var(--timeline-transition);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.completion-checkmark.checkmark-visible {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
    animation: checkmarkPop 0.5s ease-out;
}

@keyframes checkmarkPop {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(10deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

/* Step States - упрощенная версия */
.timeline-step.processing .step-circle {
    /* Убираем анимацию для стабильности */
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--timeline-glow);
}

.timeline-step.active .step-circle {
    background: linear-gradient(135deg, 
        var(--timeline-primary) 0%, 
        var(--timeline-secondary) 100%);
    border-color: var(--timeline-primary);
    transform: scale(1.15);
    box-shadow: 
        0 0 30px var(--timeline-glow),
        0 8px 16px rgba(0, 0, 0, 0.4),
        inset 0 -2px 8px rgba(255, 255, 255, 0.2);
}

.timeline-step.active .step-circle span {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.timeline-step.completed .step-circle {
    background: linear-gradient(135deg, 
        var(--timeline-primary) 0%, 
        #e6941a 100%);
    border-color: var(--timeline-primary);
    transform: scale(1);
}

.timeline-step.completed .step-circle span {
    color: white;
    opacity: 0;
    transform: scale(0.8);
}

/* Celebration Animation */
.timeline-step.celebration .step-circle {
    animation: celebrationBounce 1s ease-in-out;
}

@keyframes celebrationBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-10px) scale(1.1); }
    50% { transform: translateY(0) scale(1.05); }
    75% { transform: translateY(-5px) scale(1.08); }
}

/* Step Content */
.step-content {
    margin-top: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.step-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #e8e8e8;
    transition: all 0.3s ease;
}

.step-content p {
    font-size: 13px;
    color: #a0a4b8;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.timeline-step.active .step-content h3 {
    color: var(--timeline-primary);
    transform: scale(1.05);
}

.timeline-step.completed .step-content h3 {
    color: var(--timeline-primary);
}

/* Entrance Animations */
.entrance-fade {
    animation: fadeIn 0.5s ease-out;
}

.entrance-scale {
    animation: scaleIn 0.5s var(--timeline-transition);
}

.entrance-slide {
    animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

@keyframes slideUp {
    from { 
        transform: translateY(20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Responsive Design - iPhone 8 to 16 Pro Max */
@media (max-width: 768px) {
    .timeline-track {
        padding: 0 20px;
    }
    
    .timeline-steps {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px 20px;
        padding: 20px 0;
    }
    
    .timeline-steps::before {
        display: none;
    }
    
    .timeline-progress {
        display: none !important;
    }
    
    /* Mobile optimized design - clean card approach without lines */
    .timeline-step {
        background: rgba(35, 41, 55, 0.3);
        padding: 15px;
        border-radius: 12px;
        border: 2px solid rgba(245, 166, 35, 0.15);
        backdrop-filter: blur(10px);
        transition: all 0.3s ease;
        position: relative;
        overflow: visible;
    }
    
    .timeline-step:hover {
        background: rgba(35, 41, 55, 0.5);
        border-color: rgba(245, 166, 35, 0.3);
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }
    
    .timeline-step.active {
        background: rgba(245, 166, 35, 0.15);
        border-color: var(--timeline-primary);
        box-shadow: 0 0 25px rgba(245, 166, 35, 0.4);
        transform: scale(1.05);
    }
    
    .timeline-step.completed {
        background: rgba(245, 166, 35, 0.08);
        border-color: rgba(245, 166, 35, 0.6);
        position: relative;
    }
    
    /* Убираем все визуальные соединители на мобильных */
    .timeline-step::after,
    .timeline-step::before {
        display: none !important;
    }
    
    .step-circle {
        width: 50px;
        height: 50px;
    }
    
    .step-circle span {
        font-size: 18px;
    }
    
    .step-content h3 {
        font-size: 14px;
    }
    
    .step-content p {
        font-size: 12px;
    }
    
    .progress-ring {
        width: 54px;
        height: 54px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .timeline-track {
        padding: 0 30px;
    }
    
    .step-circle {
        width: 55px;
        height: 55px;
    }
    
    .step-circle span {
        font-size: 18px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .timeline-progress,
    .timeline-steps::before {
        transform: translateZ(0);
        will-change: width;
    }
    
    .step-circle {
        transform: translateZ(0);
        will-change: transform;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .timeline-step {
        --timeline-dark: #1a1f2e;
        --timeline-light: #2d3445;
    }
}

/* Print Styles */
@media print {
    .timeline-progress,
    .progress-shimmer,
    .pulse-container,
    .particle-container,
    .step-glow {
        display: none !important;
    }
    
    .timeline-step {
        page-break-inside: avoid;
    }
}