/* ============================================
   CUSTOMER JOURNEY - Journey Tracking Interface
   Bolivia Import Manager
   ============================================ */

/* ============================================
   JOURNEY HERO TRACKER
   ============================================ */

.bim-journey-hero {
    background: linear-gradient(135deg, #f0f9ff 0%, #fef3f8 100%);
    border-radius: var(--bim-radius-lg);
    padding: var(--bim-space-8);
    margin-bottom: var(--bim-space-8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.bim-journey-header {
    text-align: center;
    margin-bottom: var(--bim-space-8);
}

.bim-user-avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--bim-space-4);
}

.bim-user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.bim-user-avatar-lg {
    width: 80px;
    height: 80px;
    border: 4px solid white;
}

.bim-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Hide Gravatar by default until we have real profile pics */
}

.bim-avatar-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bim-avatar-gradient-start) 0%, var(--bim-avatar-gradient-end) 100%);
    color: white;
    font-size: var(--bim-text-2xl);
    font-weight: var(--bim-font-bold);
    letter-spacing: 0.5px;
    z-index: 1; /* Show initials by default */
}

.bim-user-avatar-lg .bim-avatar-fallback {
    font-size: var(--bim-text-3xl);
}

.bim-journey-header h1 {
    font-size: 28px; /* Intentionally between --bim-text-2xl (24px) and --bim-text-3xl (30px) */
    font-weight: var(--bim-font-bold);
    color: var(--bim-dark);
    margin: 0 0 var(--bim-space-2) 0;
}

.bim-journey-header p {
    font-size: 15px; /* --bim-text-sm (14px) + 1px for better readability */
    color: var(--bim-secondary);
    margin: 0;
}

/* Journey Tracker Path */
.bim-journey-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--bim-space-6);
    padding: 0 var(--bim-space-10);
}

.bim-journey-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bim-space-2);
    position: relative;
    z-index: 2;
}

.bim-stage-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--bim-text-3xl);
    background: var(--bim-journey-stage-upcoming-bg);
    border: 3px solid var(--bim-journey-stage-upcoming-border);
    transition: all 0.3s ease;
    position: relative;
}

/* Completed stage */
.bim-journey-stage[data-status="completed"] .bim-stage-icon {
    background: var(--bim-journey-stage-completed-bg);
    border-color: var(--bim-journey-stage-completed-border);
}

/* Active stage */
.bim-journey-stage[data-status="active"] .bim-stage-icon {
    background: var(--bim-journey-stage-active-bg);
    border-color: var(--bim-journey-stage-active-border);
    box-shadow: 0 0 0 var(--bim-space-2) rgba(59, 130, 246, 0.1);
}

/* Upcoming stage */
.bim-journey-stage[data-status="upcoming"] .bim-stage-icon {
    background: var(--bim-journey-stage-upcoming-bg);
    border-color: var(--bim-journey-stage-upcoming-border);
}

/* Stage label */
.bim-journey-stage > span {
    font-size: 11px; /* --bim-text-xs (12px) - 1px for compact look */
    font-weight: var(--bim-font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bim-secondary);
}

.bim-journey-stage[data-status="active"] > span {
    color: var(--bim-primary);
    font-weight: var(--bim-font-bold);
}

/* Pulse animation for active stage */
.bim-stage-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    animation: bimPulseRing 2s ease-out infinite;
}

@keyframes bimPulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ETA badge */
.bim-stage-eta {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bim-journey-eta-bg);
    color: white;
    padding: var(--bim-space-1) var(--bim-space-3);
    border-radius: var(--bim-radius-sm);
    font-size: 10px; /* --bim-text-xs (12px) - 2px for very compact badge */
    font-weight: var(--bim-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 2px 8px var(--bim-journey-eta-shadow);
}

/* Journey path connector */
.bim-journey-path {
    flex: 1;
    height: 3px;
    background: var(--bim-journey-path-default);
    position: relative;
    margin: 0 -2px;
    z-index: 1;
}

.bim-journey-stage[data-status="completed"] + .bim-journey-path {
    background: linear-gradient(90deg, var(--bim-journey-path-completed) 0%, var(--bim-journey-path-completed) 100%);
}

.bim-journey-stage[data-status="active"] + .bim-journey-path {
    background: linear-gradient(90deg, var(--bim-journey-path-completed) 0%, var(--bim-journey-path-completed) 50%, var(--bim-journey-path-default) 50%, var(--bim-journey-path-default) 100%);
    overflow: hidden;
}

.bim-journey-stage[data-status="active"] + .bim-journey-path::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    animation: bimPathShimmer 2s ease-in-out infinite;
}

@keyframes bimPathShimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

/* Journey metadata */
.bim-journey-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--bim-space-6);
    padding-top: var(--bim-space-4);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.bim-tracking-code {
    font-family: var(--bim-font-mono);
    font-size: var(--bim-text-xs);
    font-weight: var(--bim-font-semibold);
    color: var(--bim-secondary);
    padding: 6px var(--bim-space-3);
    background: white;
    border-radius: var(--bim-radius-sm);
    border: 1px solid var(--bim-border);
}

.bim-journey-progress {
    font-size: 13px; /* --bim-text-sm (14px) - 1px */
    font-weight: var(--bim-font-semibold);
    color: var(--bim-primary);
}

/* Empty state (no active order) */
.bim-journey-hero-empty {
    text-align: center;
    padding: 56px var(--bim-space-8);
    position: relative;
}

.bim-journey-hero-empty::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        var(--bim-blue-100) 0px,
        var(--bim-blue-100) 10px,
        transparent 10px,
        transparent 20px
    );
    opacity: 0.4;
    pointer-events: none;
}

.bim-journey-hero-empty .bim-user-avatar-container {
    margin-bottom: var(--bim-space-6);
}

.bim-journey-hero-empty .bim-empty-icon {
    font-size: 72px;
    margin-bottom: var(--bim-space-6);
    opacity: 0.6;
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.15));
}

.bim-journey-hero-empty h2 {
    font-size: 26px; /* Between --bim-text-2xl (24px) and --bim-text-3xl (30px) */
    font-weight: var(--bim-font-bold);
    color: var(--bim-dark);
    margin: 0 0 var(--bim-space-3) 0;
    letter-spacing: -0.02em;
}

.bim-journey-hero-empty p {
    font-size: 15px; /* --bim-text-sm (14px) + 1px */
    color: var(--bim-secondary);
    margin: 0 0 var(--bim-space-8) 0;
    line-height: 1.6;
}

/* ============================================
   JOURNEY CARDS GRID
   ============================================ */

.bim-journey-cards-grid {
    display: grid;
    gap: var(--bim-space-5);
}

.bim-journey-card {
    background: white;
    border-radius: var(--bim-radius-lg);
    border: 1px solid var(--bim-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
}

.bim-journey-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Card Header */
.bim-card-header {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: var(--bim-space-4);
    padding: var(--bim-space-6);
    align-items: center;
}

.bim-card-product-image {
    width: 100px;
    height: 100px;
    border-radius: var(--bim-radius);
    object-fit: cover;
    border: 1px solid rgba(59, 130, 246, 0.1);
    background: var(--bim-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

.bim-card-product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--bim-radius);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.bim-card-product-placeholder {
    width: 100px;
    height: 100px;
    border-radius: var(--bim-radius);
    background: var(--bim-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bim-secondary);
    border: 1px solid var(--bim-border);
}

.bim-card-product-placeholder .material-symbols-outlined {
    font-size: 40px;
}

.bim-card-title-group h3 {
    font-size: var(--bim-text-base);
    font-weight: var(--bim-font-semibold);
    color: var(--bim-dark);
    margin: 0 0 var(--bim-space-1) 0;
    line-height: 1.3;
}

.bim-card-order-code {
    font-family: var(--bim-font-mono);
    font-size: var(--bim-text-xs);
    color: var(--bim-secondary);
    font-weight: var(--bim-font-medium);
}

.bim-card-actions {
    display: flex;
    gap: var(--bim-space-2);
}

.bim-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--bim-radius);
    border: 1px solid var(--bim-border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    text-decoration: none;
    color: var(--bim-secondary);
}

.bim-btn-icon .material-symbols-outlined {
    font-size: 20px;
    transition: color 0.2s ease;
}

.bim-btn-icon:hover {
    background: var(--bim-light);
    border-color: var(--bim-primary);
}

.bim-btn-icon:hover .material-symbols-outlined {
    color: var(--bim-primary);
}

/* Card Journey Mini Path */
.bim-card-journey-mini {
    padding: var(--bim-space-5) var(--bim-space-6);
    background: linear-gradient(to bottom, #fafbfc 0%, var(--bim-gray-50) 100%);
    border-top: 1px solid var(--bim-border);
    border-bottom: 1px solid var(--bim-border);
}

.bim-mini-path {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 0 var(--bim-space-2);
}

.bim-mini-stage {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--bim-text-lg);
    background: white;
    border: 2.5px solid var(--bim-journey-stage-upcoming-border);
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.bim-mini-stage.completed {
    background: var(--bim-journey-stage-completed-bg);
    border-color: var(--bim-journey-stage-completed-border);
}

.bim-mini-stage.active {
    background: var(--bim-journey-stage-active-bg);
    border-color: var(--bim-journey-stage-active-border);
    box-shadow: 0 0 0 var(--bim-space-1) rgba(59, 130, 246, 0.1);
}

.bim-mini-line {
    flex: 1;
    height: 2px;
    background: var(--bim-journey-path-default);
    margin: 0 -2px;
    z-index: 1;
}

.bim-mini-stage.completed ~ .bim-mini-line {
    background: var(--bim-journey-path-completed);
}

/* Card Meta */
.bim-card-meta {
    display: flex;
    justify-content: space-around;
    padding: var(--bim-space-5) var(--bim-space-6);
    gap: var(--bim-space-4);
}

.bim-meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--bim-space-2);
    flex: 1;
    min-width: 0;
}

.bim-meta-label {
    font-size: 11px; /* --bim-text-xs (12px) - 1px */
    font-weight: var(--bim-font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bim-secondary);
}

.bim-meta-value {
    font-size: var(--bim-text-base);
    font-weight: var(--bim-font-bold);
    color: var(--bim-dark);
}

/* ============================================
   FLOATING QUOTE REQUEST (Sidebar Primary CTA)
   ============================================ */

.bim-quote-request-float {
    background: linear-gradient(135deg, var(--bim-blue-500) 0%, var(--bim-info) 100%);
    border-radius: var(--bim-radius-lg);
    padding: var(--bim-space-6);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
    color: white;
    text-align: center;
    margin-bottom: var(--bim-space-5);
    position: relative;
    overflow: hidden;
}

.bim-quote-request-float::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: bimFloatGlow 8s ease-in-out infinite;
    pointer-events: none; /* Prevent blocking clicks on button */
}

@keyframes bimFloatGlow {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(-20%, -20%);
    }
}

.bim-float-icon {
    font-size: 48px;
    margin-bottom: var(--bim-space-3);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.bim-quote-request-float h2 {
    font-size: var(--bim-text-lg);
    font-weight: var(--bim-font-bold);
    margin: 0 0 var(--bim-space-2) 0;
    position: relative;
    z-index: 1;
}

.bim-quote-request-float p {
    font-size: var(--bim-text-sm);
    margin: 0 0 var(--bim-space-5) 0;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Context-specific: Ensure button is above glow effect */
.bim-quote-request-float .bim-btn {
    position: relative;
    z-index: 2;
}

/* ============================================
   COMPACT STATS (Sidebar)
   ============================================ */

.bim-quick-stats {
    display: flex;
    flex-direction: column;
    gap: var(--bim-space-4);
    background: white;
    border-radius: var(--bim-radius-lg);
    padding: var(--bim-space-5);
    border: 1px solid var(--bim-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: var(--bim-space-5);
}

.bim-stat-compact {
    display: flex;
    align-items: center;
    gap: var(--bim-space-4);
    padding: var(--bim-space-4);
    background: linear-gradient(to right, var(--bim-gray-50) 0%, white 100%);
    border-radius: var(--bim-radius);
    border: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.2s ease;
}

.bim-stat-compact:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.bim-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bim-blue-100) 0%, var(--bim-info-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.bim-stat-icon .material-symbols-outlined {
    font-size: var(--bim-text-2xl);
    color: var(--bim-primary);
}

.bim-stat-content {
    display: flex;
    flex-direction: column;
    gap: var(--bim-space-1);
    flex: 1;
}

.bim-stat-label {
    font-size: var(--bim-text-xs);
    font-weight: var(--bim-font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bim-secondary);
}

.bim-stat-number {
    font-size: 28px; /* Intentionally larger than --bim-text-2xl for emphasis */
    font-weight: var(--bim-font-bold);
    color: var(--bim-primary);
    line-height: 1;
}

.bim-stat-divider {
    display: none;
}

/* ============================================
   COMPACT EXCHANGE RATE (Sidebar)
   ============================================ */

.bim-rate-compact {
    background: linear-gradient(135deg, var(--bim-amber-100) 0%, #fef9e5 100%);
    border-radius: var(--bim-radius-lg);
    padding: var(--bim-space-5) var(--bim-space-6);
    border: 1px solid var(--bim-amber-200);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
    position: relative;
    overflow: hidden;
}

.bim-rate-compact::before {
    content: '💵';
    position: absolute;
    top: 50%;
    right: var(--bim-space-5);
    transform: translateY(-50%);
    font-size: 48px;
    opacity: 0.2;
}

.bim-rate-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.bim-rate-label {
    font-size: 11px; /* --bim-text-xs (12px) - 1px */
    font-weight: var(--bim-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bim-amber-900);
}

.bim-rate-value {
    font-size: var(--bim-text-2xl);
    font-weight: var(--bim-font-bold);
    color: var(--bim-amber-900);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1100px) {
    .bim-journey-hero {
        padding: var(--bim-space-6);
    }

    .bim-journey-tracker {
        padding: 0 20px;
    }
}

@media (max-width: 900px) {
    .bim-journey-tracker {
        flex-wrap: wrap;
        gap: var(--bim-space-4);
        padding: 0;
    }

    .bim-journey-stage {
        flex: 1;
        min-width: 60px;
    }

    .bim-journey-path {
        display: none;
    }

    .bim-stage-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .bim-journey-stage > span {
        font-size: 10px;
    }

    .bim-card-header {
        grid-template-columns: 80px 1fr;
        gap: var(--bim-space-3);
    }

    .bim-card-product-image,
    .bim-card-product-placeholder {
        width: 80px;
        height: 80px;
    }

    .bim-card-actions {
        grid-column: 2;
    }

    .bim-mini-path {
        gap: var(--bim-space-2);
    }

    .bim-mini-stage {
        width: 32px;
        height: 32px;
        font-size: var(--bim-text-sm);
    }

    .bim-mini-line {
        flex: 0 0 var(--bim-space-5);
    }
}

@media (max-width: 640px) {
    .bim-journey-hero {
        padding: var(--bim-space-5) var(--bim-space-4);
        margin-bottom: var(--bim-space-5);
    }

    .bim-user-avatar {
        width: 56px;
        height: 56px;
        border: 2.5px solid white;
    }

    .bim-user-avatar-lg {
        width: 72px;
        height: 72px;
        border: 3px solid white;
    }

    .bim-avatar-fallback {
        font-size: var(--bim-text-xl);
    }

    .bim-user-avatar-lg .bim-avatar-fallback {
        font-size: 26px; /* Between --bim-text-2xl and --bim-text-3xl */
    }

    .bim-journey-header h1 {
        font-size: 22px; /* Smaller for mobile */
    }

    .bim-journey-header p {
        font-size: var(--bim-text-sm);
    }

    .bim-journey-tracker {
        gap: var(--bim-space-3);
    }

    .bim-stage-icon {
        width: 56px;
        height: 56px;
        font-size: var(--bim-text-2xl);
    }

    .bim-stage-eta {
        font-size: 9px; /* Very small for mobile */
        padding: 3px var(--bim-space-2);
    }

    .bim-journey-meta {
        flex-direction: column;
        gap: var(--bim-space-3);
    }

    .bim-card-header {
        grid-template-columns: 1fr;
        gap: var(--bim-space-3);
    }

    .bim-card-product-image,
    .bim-card-product-placeholder {
        width: 100%;
        height: 160px;
    }

    .bim-card-meta {
        flex-direction: column;
        gap: var(--bim-space-3);
        align-items: stretch;
    }

    .bim-meta-item {
        flex-direction: row;
        justify-content: space-between;
    }

    .bim-quick-stats {
        flex-direction: column;
        gap: var(--bim-space-4);
        padding: var(--bim-space-5);
    }

    .bim-stat-divider {
        width: 100%;
        height: 1px;
    }
}
