/* Container */
.bhv-tracker-widget {
    max-width: 960px;
    margin: 40px auto;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bhv-body-bg, #ffffff);
}

/* Search Box */
.bhv-search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 12px;
}

#bhv-code-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
}

#bhv-code-input:focus {
    border-color: var(--bhv-step-completed-bg, #4BE296);
    outline: none;
}

#bhv-track-btn {
    padding: 12px 25px;
    background: var(--bhv-button-bg, #1F2F28);
    color: var(--bhv-button-text, #ffffff);
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 10px 25px rgba(0,0,0,0.16);
}

#bhv-track-btn:hover {
    background: var(--bhv-button-hover-bg, #2a3f36);
    color: var(--bhv-button-hover-text, #ffffff);
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.22);
}

/* Result Card */
.bhv-tracker-card {
    background: var(--bhv-card-bg, #ffffff);
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
}

/* Header Styling - Updated */
.bhv-header {
    background: var(--bhv-header-bg, #1F2F28);
    color: var(--bhv-header-text, #ffffff);
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bhv-header-info h3 {
    margin: 0;
    font-size: 22px;
    color: var(--bhv-header-text, #ffffff);
    font-weight: 600;
}

.bhv-customer {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: var(--bhv-client-font-size, 15px);
    color: var(--bhv-client-text-color, rgba(255,255,255,0.85));
}

.bhv-customer-website a {
    color: var(--bhv-website-text-color, #4BE296);
    font-size: var(--bhv-website-font-size, 20px);
    font-weight: 600;
    text-decoration: underline;
    word-break: break-all;
}

.bhv-code-display {
    background: rgba(255,255,255,0.15);
    padding: 12px 20px;
    border-radius: 12px;
    font-family: monospace;
    letter-spacing: 1px;
    color: var(--bhv-header-text, #ffffff);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 260px;
}

.bhv-code-text {
    font-weight: 600;
    font-size: var(--bhv-code-font-size, 25px);
}

.bhv-estimates {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: var(--bhv-estimates-font-size, 13px);
    line-height: 1.5;
}

.bhv-estimate-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.bhv-estimate-row .label {
    opacity: 0.8;
    color: var(--bhv-estimates-label-color, #e5e7eb);
}

.bhv-estimate-row .value {
    font-weight: 600;
    color: var(--bhv-estimates-value-color, #ffffff);
}

/* Timeline */
.bhv-timeline {
    padding: 30px;
}

.bhv-step {
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 2;
    padding-bottom: 25px; /* Spacing */
}

/* Step Marker (Circle) - Updated */
.bhv-step-marker {
    width: 45px; /* Bigger */
    height: 45px; /* Bigger */
    border-radius: 50%;
    background: var(--bhv-step-pending-bg, #f0f0f0);
    color: var(--bhv-step-pending-text, #999999);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700; /* Bold */
    font-size: 18px; /* Bigger number */
    margin-right: 20px;
    border: 2px solid #eee;
    transition: all 0.3s;
    flex-shrink: 0;
}

/* Connector Line */
.bhv-connector {
    position: absolute;
    left: 22.5px; /* Center of 45px marker */
    top: 45px;
    bottom: -5px;
    width: 2px;
    background: transparent; /* remove vertical connector line to keep card clean */
    z-index: 1;
    margin-left: -1px;
}

.bhv-step:last-child .bhv-connector {
    display: none;
}

/* Completed State */
.bhv-step.completed .bhv-step-marker {
    background: var(--bhv-step-completed-bg, #4BE296);
    border-color: var(--bhv-step-completed-bg, #4BE296);
    color: var(--bhv-step-completed-text, #000000);
}

.bhv-connector.completed {
    background: transparent; /* keep line hidden even for completed segments */
}

/* Current State */
.bhv-step.current .bhv-step-marker {
    background: #ffffff;
    border-color: var(--bhv-step-current-bg, #4BE296);
    color: var(--bhv-step-current-text, #4BE296);
    box-shadow: 0 0 0 4px rgba(75, 226, 150, 0.2);
}

/* Step Text - Updated */
.bhv-step-content {
    flex: 1;
    padding-top: 8px; /* Align with circle center */
}

.bhv-step-content h4 {
    margin: 0 0 5px 0;
    font-size: var(--bhv-step-title-font-size, 18px);
    color: #333;
    display: flex;
    align-items: center;
}

.bhv-step.completed h4 { color: #888; }
.bhv-step.current h4 { color: #000; font-weight: 700; }

.bhv-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-top: 5px;
}

/* Tooltip - Updated */
.bhv-info-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px; /* Bigger icon */
    height: 22px;
    background: var(--bhv-info-icon-bg, #eeeeee);
    color: var(--bhv-info-icon-color, #666666);
    border-radius: 50%;
    margin-left: 10px;
    font-size: 14px;
    cursor: help;
    position: relative;
    font-weight: bold;
    font-family: serif;
}

.bhv-tooltip {
    visibility: hidden;
    width: 240px;
    background-color: var(--bhv-header-bg, #1F2F28);
    color: var(--bhv-header-text, #ffffff);
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.6;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-family: sans-serif;
}

.bhv-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--bhv-header-bg, #1F2F28) transparent transparent transparent;
}

.bhv-info-icon:hover .bhv-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Notes */
.bhv-admin-notes {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 10px 30px 30px;
    font-size: 14px;
    color: #555;
}

.bhv-error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.bhv-step-timestamp {
    margin-top: 2px;
    font-size: 11px;
    color: #6b7280;
}

/* Pulsing animation for active step */
@keyframes bhv-pulse {
    0% { box-shadow: 0 0 0 0 rgba(70, 188, 129, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(75, 226, 150, 0); }
    100% { box-shadow: 0 0 0 0 rgba(75, 226, 150, 0); }
}

.bhv-step.current .bhv-step-marker {
    animation: bhv-pulse 1.6s infinite;
}

/* Responsive search layout */
@media (max-width: 600px) {
    .bhv-search-box {
        flex-direction: column;
        align-items: stretch;
    }

    #bhv-track-btn {
        width: 100%;
        text-align: center;
    }

    /* Keep tooltip visible on small screens */
    .bhv-tooltip {
        width: 80vw;
        left: 50%;
        transform: translateX(-50%);
        bottom: 120%;
    }
}