/* ==============================================
   EmergencyHelper - Wizard Styles
   Multi-step booking wizard with live matching
   ============================================== */

/* ===== Progress Bar ===== */
.wizard-progress {
    position: relative;
}

.wizard-progress-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.wizard-progress-fill {
    height: 100%;
    background: var(--eh-primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.wizard-step.active,
.wizard-step.completed {
    opacity: 1;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.wizard-step.active .step-dot {
    background: var(--eh-primary);
    color: #fff;
}

.wizard-step.completed .step-dot {
    background: var(--eh-success);
    color: #fff;
}

.wizard-step span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
}

/* ===== Wizard Icon ===== */
.wizard-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF0E8, #FFE0CC);
    color: var(--eh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

/* ===== Wizard Panel Transitions ===== */
.wizard-panel {
    animation: fadeInUp 0.3s ease;
}

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

/* ===== Service Select Cards ===== */
.service-select-card {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.service-select-card:hover {
    border-color: var(--eh-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.service-select-card.selected {
    border-color: var(--eh-primary);
    background: linear-gradient(135deg, #FFF8F5, #FFF0E8);
    box-shadow: 0 0 0 3px rgba(232, 67, 10, 0.15);
}

.service-select-card i {
    font-size: 2.5rem;
    color: var(--eh-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.service-select-card h5 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.service-select-card small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* ===== Matching Animation ===== */
.matching-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--eh-primary);
    animation: radarPulse 2s infinite;
}

.radar-pulse::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 1px solid var(--eh-primary);
    animation: radarPulse 2s 0.5s infinite;
}

@keyframes radarPulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

.matching-timer {
    font-size: 1.1rem;
}

/* ===== Matched Check ===== */
.matched-check {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--eh-success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto;
    animation: bounceIn 0.5s ease;
}

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

.matched-helper-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.5rem;
}

/* ===== Helper Service Cards (Step 4) ===== */
.helper-service-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 1rem 1.15rem;
    margin-bottom: 0.65rem;
    transition: all 0.3s ease;
    animation: fadeInUp 0.3s ease;
}

.helper-service-card:hover {
    border-color: #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Fade-out animation for helpers going offline */
.helper-service-card.removing {
    animation: fadeOutDown 0.4s ease forwards;
}

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

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* ===== Helper Portal: Check-in ===== */
.checkin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.checkin-toggle.checked-out {
    background: var(--eh-primary);
    color: #fff;
}

.checkin-toggle.checked-out:hover {
    background: var(--eh-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 67, 10, 0.3);
}

.checkin-toggle.checked-in {
    background: var(--eh-success);
    color: #fff;
}

.checkin-toggle.checked-in:hover {
    background: #218838;
}

/* ===== Incoming Job Alert ===== */
.job-alert {
    background: #fff;
    border: 2px solid var(--eh-primary);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 20px rgba(232, 67, 10, 0.15);
    animation: slideInAlert 0.4s ease;
}

.job-alert.taken {
    opacity: 0.5;
    border-color: #e9ecef;
    box-shadow: none;
}

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

.job-alert .alert-badge {
    display: inline-block;
    background: var(--eh-primary);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* ===== Chat UI ===== */
.chat-messages-container {
    height: 350px;
    overflow-y: auto;
    background: #f0f2f5;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-bubble-left,
.chat-bubble-right {
    max-width: 80%;
    animation: fadeInUp 0.2s ease;
}

.chat-bubble-left {
    align-self: flex-start;
}

.chat-bubble-right {
    align-self: flex-end;
}

.chat-bubble-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 2px;
    padding: 0 4px;
}

.chat-bubble-right .chat-bubble-name {
    text-align: right;
}

.chat-bubble-content {
    padding: 0.5rem 0.85rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-bubble-left .chat-bubble-content {
    background: #fff;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

.chat-bubble-right .chat-bubble-content {
    background: var(--eh-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble-time {
    font-size: 0.65rem;
    color: #999;
    margin-top: 2px;
    padding: 0 4px;
}

.chat-bubble-right .chat-bubble-time {
    text-align: right;
}

.chat-system-msg {
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 0.4rem 0.75rem;
    margin: 0.25rem auto;
    max-width: 90%;
}

.chat-input-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fff;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
}

.chat-input-bar .form-control {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
}

.chat-input-bar .form-control:focus {
    border-color: var(--eh-primary);
    box-shadow: 0 0 0 0.15rem rgba(232, 67, 10, 0.15);
}

.chat-input-bar .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .wizard-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .checkin-toggle {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .chat-messages-container,
    .chat-height-mobile {
        height: 250px;
    }

    /* Helper portal status bar */
    .status-bar-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    .service-select-card {
        padding: 1rem 0.75rem;
    }

    .service-select-card i {
        font-size: 2rem;
    }

    .service-select-card h5 {
        font-size: 0.9rem;
    }

    .wizard-step span {
        font-size: 0.75rem;
    }

    .step-dot {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .chat-messages-container,
    .chat-height-mobile {
        height: 220px;
    }

    .chat-bubble-left,
    .chat-bubble-right {
        max-width: 90%;
    }

    .wizard-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .checkin-toggle {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Wizard map */
    #wizard-map,
    .wizard-map-container {
        height: 240px !important;
    }

    /* Onboarding coverage map */
    #coverage-map {
        height: 220px !important;
    }

    /* Timer buttons wrap */
    .timer-actions {
        flex-wrap: wrap;
    }
}
