/*
Enhanced Progress Tracker CSS
Beautiful, animated progress tracking for client dashboard
*/

/* ========================================
   MODERN PROGRESS TIMELINE
   ======================================== */

.progress-timeline {
    position: relative;
    padding: 20px 0;
    margin: 30px 0;
}

.progress-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInLeft 0.6s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-marker {
    position: absolute;
    left: 16px;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: white;
    border: 3px solid #e5e7eb;
    color: #6b7280;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Completed state */
.timeline-item.completed .timeline-marker {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    animation: bounceIn 0.6s ease-out;
}

/* In-progress state */
.timeline-item.in-progress .timeline-marker {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: white;
    animation: pulseMarker 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Pending state */
.timeline-item.pending .timeline-marker {
    background: white;
    border-color: #e5e7eb;
    color: #9ca3af;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes pulseMarker {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 25px rgba(99, 102, 241, 0.6);
    }
}

.timeline-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-item.completed .timeline-content::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    opacity: 1;
}

.timeline-item.in-progress .timeline-content::before {
    opacity: 1;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #6366f1;
}

.timeline-content h6 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.timeline-content p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.timeline-content small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

/* ========================================
   PROGRESS STATS CARDS
   ======================================== */

.progress-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.progress-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-stat-card:hover::before {
    opacity: 1;
}

.progress-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border-color: #6366f1;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.progress-stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-icon.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-icon.in-progress {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    animation: pulseIcon 2s ease-in-out infinite;
}

.stat-icon.pending {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #9ca3af;
}

@keyframes pulseIcon {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    }
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 8px 0;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-sublabel {
    font-size: 12px;
    color: #9ca3af;
}

/* ========================================
   ANIMATED PROGRESS BARS
   ======================================== */

.progress {
    height: 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 100%);
    overflow: visible;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-bar {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    border-radius: 10px;
    position: relative;
    overflow: visible;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    animation: progressShimmer 2s ease-in-out infinite;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 100%);
    border-radius: 0 10px 10px 0;
}

@keyframes progressShimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ========================================
   CIRCULAR PROGRESS INDICATORS
   ======================================== */

.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
    display: inline-block;
}

.circular-progress svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.circular-progress-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 8;
}

.circular-progress-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 377; /* 2 * PI * 60 */
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.4));
    animation: rotateFill 3s ease-in-out infinite;
}

@keyframes rotateFill {
    0%, 100% {
        stroke: url(#progressGradient);
    }
    50% {
        filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.6));
    }
}

.circular-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.circular-progress-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    display: block;
    margin-top: 4px;
}

/* ========================================
   MILESTONE BADGES
   ======================================== */

.milestone-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: white;
    border: 2px solid;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

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

.milestone-badge.completed {
    border-color: #10b981;
    color: #059669;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.milestone-badge.in-progress {
    border-color: #6366f1;
    color: #4f46e5;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    animation: pulseScale 2s ease-in-out infinite;
}

.milestone-badge.pending {
    border-color: #e5e7eb;
    color: #6b7280;
    background: #f9fafb;
}

@keyframes pulseScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.milestone-badge i {
    font-size: 14px;
}

/* ========================================
   STEP PROGRESS INDICATOR
   ======================================== */

.step-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px 0;
    position: relative;
}

.step-progress::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 60px;
    right: 60px;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}

.step-progress-bar {
    position: absolute;
    top: 25px;
    left: 60px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    z-index: 1;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #9ca3af;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
}

.step-item.completed .step-circle {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: white;
    animation: pulseStep 2s ease-in-out infinite;
}

@keyframes pulseStep {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 25px rgba(99, 102, 241, 0.6);
    }
}

.step-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.step-item.completed .step-label,
.step-item.active .step-label {
    color: #1f2937;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .progress-timeline::before {
        left: 15px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-marker {
        left: 8px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .progress-stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .step-progress {
        flex-direction: column;
        gap: 20px;
    }
    
    .step-progress::before,
    .step-progress-bar {
        display: none;
    }
    
    .step-item {
        width: 100%;
    }
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */

@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton-loader {
    background: linear-gradient(90deg, #f3f4f6 0px, #e5e7eb 40px, #f3f4f6 80px);
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}
