/* ==============================================
   Loading Card - Inline rich loading UI
   ============================================== */

/* Card container */
.loading-card {
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px 40px;
    width: 420px;
    max-width: 90%;
    margin: 32px auto;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* SVG icon area */
.lc-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
}
.lc-icon svg {
    width: 64px;
    height: 64px;
}

/* Chart icon - bars pulse */
.lc-icon-chart .lc-bar {
    fill: #4285f4;
    animation: lc-bar-pulse 1.2s ease-in-out infinite;
}
.lc-icon-chart .lc-bar:nth-child(1) { animation-delay: 0s; }
.lc-icon-chart .lc-bar:nth-child(2) { animation-delay: 0.2s; }
.lc-icon-chart .lc-bar:nth-child(3) { animation-delay: 0.4s; }
.lc-icon-chart .lc-bar:nth-child(4) { animation-delay: 0.6s; }

@keyframes lc-bar-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* Leaf icon - gentle sway */
.lc-icon-leaf .lc-leaf {
    fill: #34a853;
    transform-origin: 32px 50px;
    animation: lc-leaf-sway 3s ease-in-out infinite;
}

@keyframes lc-leaf-sway {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
}

/* Gear icon - rotate */
.lc-icon-gear .lc-gear {
    fill: #4285f4;
    transform-origin: center;
    animation: lc-gear-spin 2s linear infinite;
}

@keyframes lc-gear-spin {
    to { transform: rotate(360deg); }
}

/* Indeterminate progress bar */
.loading-card.is-indeterminate .lc-progress-bar {
    width: 40% !important;
    animation: lc-indeterminate 1.8s ease-in-out infinite;
}

@keyframes lc-indeterminate {
    0% { margin-left: 0; width: 30%; }
    50% { margin-left: 35%; width: 40%; }
    100% { margin-left: 70%; width: 30%; }
}

/* Title */
.lc-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

/* Status text */
.lc-status {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
    min-height: 20px;
    transition: opacity 0.3s ease;
}

/* Progress bar */
.lc-progress-wrap {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}
.lc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4285f4, #34a853);
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease;
}

/* Steps */
.lc-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}
.lc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}
.lc-step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
    margin-bottom: 6px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}
.lc-step.is-active .lc-step-dot {
    background: #4285f4;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.2);
    animation: lc-step-pulse 1.5s ease-in-out infinite;
}
.lc-step.is-done .lc-step-dot {
    background: #34a853;
    color: #fff;
}
.lc-step-label {
    font-size: 11px;
    color: #999;
    transition: color 0.3s ease;
    white-space: nowrap;
}
.lc-step.is-active .lc-step-label,
.lc-step.is-done .lc-step-label {
    color: #333;
    font-weight: 600;
}

@keyframes lc-step-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(66, 133, 244, 0.1); }
}

/* Elapsed time */
.lc-time {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* Completion checkmark */
.lc-check {
    display: none;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}
.loading-card.is-complete .lc-check {
    display: block;
}
.loading-card.is-complete .lc-icon {
    display: none;
}
.lc-check-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #34a853;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lc-check-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.lc-check-circle svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: lc-check-draw 0.4s ease 0.3s forwards;
}

@keyframes lc-check-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
@keyframes lc-check-draw {
    to { stroke-dashoffset: 0; }
}

/* Complete state progress bar */
.loading-card.is-complete .lc-progress-bar {
    width: 100% !important;
    background: linear-gradient(90deg, #34a853, #34a853);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lc-icon-chart .lc-bar,
    .lc-icon-leaf .lc-leaf,
    .lc-icon-gear .lc-gear,
    .loading-card.is-indeterminate .lc-progress-bar,
    .lc-step.is-active .lc-step-dot,
    .lc-check-circle,
    .lc-check-circle svg {
        animation: none !important;
    }
    .lc-check-circle svg {
        stroke-dashoffset: 0;
    }
    .lc-progress-bar {
        transition: width 0.1s;
    }
}
