/* ═══════════════════════════════════════════════════════════════
   Robot Guide – User Onboarding Modal
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.robot-guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2147480080;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}
.robot-guide-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* ── Main Container ── */
.robot-guide-container {
    position: relative;
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.7) translateY(40px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.robot-guide-overlay.active .robot-guide-container {
    transform: scale(1) translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   ROBOT BODY (Pure CSS)
   ══════════════════════════════════════════════════════════════ */

/* ── Antenna ── */
.robot-antenna {
    position: relative;
    width: 6px;
    height: 30px;
    background: linear-gradient(to bottom, #ffd700, #b8860b);
    border-radius: 3px 3px 0 0;
    margin-bottom: -2px;
    z-index: 2;
}
.robot-antenna::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 35% 35%, #ffeb3b, #ffc107, #ff9800);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.6);
    animation: antenna-blink 2s ease-in-out infinite;
}
@keyframes antenna-blink {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 193, 7, 0.6); transform: translateX(-50%) scale(1); }
    50% { box-shadow: 0 0 20px rgba(255, 193, 7, 0.9); transform: translateX(-50%) scale(1.15); }
}

/* ── Head ── */
.robot-head {
    width: 200px;
    height: 140px;
    background: linear-gradient(145deg, #e8eaf6, #c5cae9);
    border-radius: 30px 30px 20px 20px;
    border: 3px solid #9fa8da;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.6);
    overflow: hidden;
}

/* ── Face Screen ── */
.robot-face {
    width: 170px;
    height: 105px;
    background: linear-gradient(135deg, #1a237e, #283593);
    border-radius: 16px;
    border: 2px solid #3949ab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* ── Eyes ── */
.robot-eyes {
    display: flex;
    gap: 30px;
    margin-bottom: 6px;
    position: relative;
    z-index: 2;
}
.robot-eye {
    width: 28px;
    height: 28px;
    background: radial-gradient(circle at 40% 40%, #00e676, #00c853, #00a844);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.6);
    position: relative;
    transition: all 0.3s ease;
}
.robot-eye::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 7px;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}
/* Blink animation */
.robot-eye.blink {
    transform: scaleY(0.1);
}

/* ── Mouth (changes shape when speaking) ── */
.robot-mouth {
    width: 50px;
    height: 8px;
    background: #00e676;
    border-radius: 4px;
    transition: all 0.15s ease;
    box-shadow: 0 0 6px rgba(0, 230, 118, 0.4);
}
.robot-mouth.speaking {
    animation: mouth-move 0.3s ease-in-out infinite alternate;
}
@keyframes mouth-move {
    0% { height: 6px; width: 40px; border-radius: 4px; }
    50% { height: 14px; width: 35px; border-radius: 50%; }
    100% { height: 4px; width: 50px; border-radius: 2px; }
}

/* ── Cheek lights ── */
.robot-cheek {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5252;
    opacity: 0.6;
    bottom: 18px;
    transition: opacity 0.3s ease;
}
.robot-cheek.left { left: 12px; }
.robot-cheek.right { right: 12px; }
.robot-cheek.glow {
    animation: cheek-glow 0.5s ease-in-out infinite alternate;
}
@keyframes cheek-glow {
    from { opacity: 0.4; box-shadow: 0 0 4px rgba(255, 82, 82, 0.3); }
    to { opacity: 0.9; box-shadow: 0 0 12px rgba(255, 82, 82, 0.7); }
}

/* ── Ears / Bolts ── */
.robot-ear {
    position: absolute;
    width: 16px;
    height: 30px;
    background: linear-gradient(145deg, #78909c, #546e7a);
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
}
.robot-ear.left { left: -10px; }
.robot-ear.right { right: -10px; }

/* ── Neck ── */
.robot-neck {
    width: 40px;
    height: 14px;
    background: linear-gradient(to bottom, #90a4ae, #78909c);
    border-radius: 0 0 6px 6px;
    margin-top: -2px;
    z-index: 1;
}

/* ── Body ── */
.robot-body {
    width: 220px;
    height: 130px;
    background: linear-gradient(145deg, #eceff1, #cfd8dc);
    border-radius: 16px 16px 24px 24px;
    border: 3px solid #90a4ae;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: -4px;
}

/* ── Chest Panel ── */
.robot-chest {
    width: 120px;
    height: 60px;
    background: linear-gradient(135deg, #1a237e, #283593);
    border-radius: 10px;
    border: 2px solid #3949ab;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}
.robot-chest-light {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.robot-chest-light.red { background: #ff5252; box-shadow: 0 0 6px rgba(255, 82, 82, 0.5); }
.robot-chest-light.yellow { background: #ffc107; box-shadow: 0 0 6px rgba(255, 193, 7, 0.5); }
.robot-chest-light.green { background: #00e676; box-shadow: 0 0 6px rgba(0, 230, 118, 0.5); }

/* ── Arms ── */
.robot-arm {
    position: absolute;
    width: 22px;
    height: 70px;
    background: linear-gradient(145deg, #b0bec5, #90a4ae);
    border-radius: 12px;
    top: 15px;
}
.robot-arm.left { left: -18px; }
.robot-arm.right { right: -18px; }
.robot-arm.wave {
    animation: arm-wave 0.6s ease-in-out;
    transform-origin: top center;
}
@keyframes arm-wave {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-20deg); }
    50% { transform: rotate(10deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

/* ══════════════════════════════════════════════════════════════
   SPEECH BUBBLE
   ══════════════════════════════════════════════════════════════ */
.robot-speech-bubble {
    background: #fff;
    border-radius: 18px;
    padding: 20px 24px;
    margin-top: 16px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

/* ── Step indicator ── */
.robot-guide-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}
.robot-guide-step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}
.robot-guide-step-dot.active {
    background: #045b52;
    width: 28px;
    border-radius: 5px;
    box-shadow: 0 0 8px rgba(4, 91, 82, 0.3);
}

/* ── Message ── */
.robot-guide-message {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    text-align: center;
    flex: 1;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.robot-guide-message .step-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}
.robot-guide-message .step-title {
    font-size: 18px;
    font-weight: 700;
    color: #045b52;
    margin-bottom: 6px;
}
.robot-guide-message .step-text {
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}
.robot-guide-step-image {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 14px;
    margin: 0 0 12px;
    border: 1px solid #e7e7e7;
}

/* ── Typing cursor ── */
.robot-guide-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: #045b52;
    margin-left: 2px;
    animation: cursor-blink 0.6s step-end infinite;
    vertical-align: middle;
}
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ── Navigation buttons ── */
.robot-guide-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 10px;
}
.robot-guide-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.robot-guide-btn:active { transform: scale(0.95); }

.robot-guide-btn.btn-skip {
    background: transparent;
    color: #999;
    border: 1px solid #ddd;
}
.robot-guide-btn.btn-skip:hover { background: #f5f5f5; color: #666; }

.robot-guide-btn.btn-next {
    background: linear-gradient(135deg, #045b52, #06796e);
    color: #fff;
    box-shadow: 0 4px 12px rgba(4, 91, 82, 0.3);
}
.robot-guide-btn.btn-next:hover {
    box-shadow: 0 6px 18px rgba(4, 91, 82, 0.45);
    transform: translateY(-1px);
}

.robot-guide-btn.btn-prev {
    background: #f0f0f0;
    color: #555;
}
.robot-guide-btn.btn-prev:hover { background: #e0e0e0; }

.robot-guide-btn.btn-done {
    background: linear-gradient(135deg, #00c853, #00a844);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 168, 68, 0.3);
}
.robot-guide-btn.btn-done:hover {
    box-shadow: 0 6px 18px rgba(0, 168, 68, 0.45);
}

.robot-guide-btn.btn-play {
    background: #e3f2fd;
    color: #1976d2;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #bbdefb;
    font-size: 13px;
}
.robot-guide-btn.btn-play:hover {
    background: #bbdefb;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}
.robot-guide-btn.btn-play.speaking {
    background: #1976d2;
    color: #fff;
    border-color: #1976d2;
    animation: play-pulse 1s ease-in-out infinite;
}
@keyframes play-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(25, 118, 210, 0); }
}

/* ── Sound toggle ── */
.robot-guide-sound-toggle {
    position: absolute;
    top: 8px;
    left: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
    z-index: 5;
}
.robot-guide-sound-toggle:hover { color: #045b52; }
.robot-guide-sound-toggle.muted { color: #ff5252; }

/* ── Close button ── */
.robot-guide-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s ease;
    z-index: 5;
}
.robot-guide-close:hover { color: #ff5252; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .robot-head { width: 150px; height: 110px; }
    .robot-face { width: 125px; height: 80px; }
    .robot-eye { width: 22px; height: 22px; }
    .robot-eyes { gap: 20px; }
    .robot-body { width: 170px; height: 100px; }
    .robot-chest { width: 90px; height: 45px; }
    .robot-speech-bubble { padding: 16px 18px; }
    .robot-guide-message .step-title { font-size: 16px; }
    .robot-guide-message .step-text { font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════════
   FLOATING ROBOT MINI (small indicator in corner)
   ══════════════════════════════════════════════════════════════ */
.robot-guide-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #045b52, #06796e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(4, 91, 82, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
    border: none;
    animation: fab-pulse 2s ease-in-out infinite;
}
.robot-guide-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(4, 91, 82, 0.55);
}
.robot-guide-fab i {
    font-size: 26px;
    color: #fff;
}
@keyframes fab-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(4, 91, 82, 0.4); }
    50% { box-shadow: 0 4px 24px rgba(4, 91, 82, 0.6), 0 0 0 8px rgba(4, 91, 82, 0.1); }
}

/* ══════════════════════════════════════════════════════════════
   ZenHR-style floating chat popup
   ══════════════════════════════════════════════════════════════ */
.robot-guide-overlay {
    background: transparent;
    backdrop-filter: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 22px 96px;
    pointer-events: none;
}
.robot-guide-overlay:has(.raqm-popup[dir="rtl"]) {
    justify-content: flex-start;
}
.robot-guide-overlay.active {
    pointer-events: none;
}
.robot-guide-container.raqm-popup {
    pointer-events: auto;
    width: min(400px, calc(100vw - 24px));
    max-height: min(68vh, 560px);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(3, 36, 37, 0.28);
    overflow: hidden;
    align-items: stretch;
    font-family: 'IBM Plex Sans Arabic', 'Familjen Grotesk', sans-serif;
    transform: translateY(28px) scale(0.98);
}
.robot-guide-overlay.active .robot-guide-container.raqm-popup {
    transform: translateY(0) scale(1);
}
.raqm-popup-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #032425;
    color: #fff;
    flex-shrink: 0;
}
.raqm-popup-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}
.raqm-popup-head-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.raqm-popup-head-copy strong { font-size: 14px; font-weight: 700; }
.raqm-popup-head-copy small { font-size: 11px; color: #9fd4c8; }
.raqm-popup .robot-guide-sound-toggle,
.raqm-popup .robot-guide-close,
.raqm-popup-min {
    position: static;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 18px;
    border: 0;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.raqm-popup .robot-guide-sound-toggle.muted { color: #fca5a5; }
.raqm-popup-body {
    padding: 16px 16px 8px;
    overflow-y: auto;
    flex: 1;
    background: #f4f7f7;
    width: 100%;
    box-sizing: border-box;
}
.raqm-popup .robot-guide-step-indicator {
    justify-content: flex-start;
    margin-bottom: 12px;
}
.raqm-popup .robot-guide-message {
    text-align: start;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 140px;
    width: 100%;
}
.raqm-chat-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
}
.raqm-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #032425;
}
.raqm-chat-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #045b52;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}
.raqm-chat-bubble {
    background: #fff;
    border: 1px solid #e6eceb;
    border-radius: 4px 16px 16px 16px;
    padding: 12px 14px 14px;
    box-shadow: 0 8px 20px rgba(3, 36, 37, 0.06);
    flex: 1;
    min-width: 0;
    text-align: start;
}
.raqm-popup[dir="rtl"] .raqm-chat-bubble {
    border-radius: 16px 4px 16px 16px;
}
.raqm-chat-name {
    font-size: 12px;
    font-weight: 700;
    color: #045b52;
    margin-bottom: 8px;
}
.raqm-popup .robot-guide-message {
    gap: 12px;
}
.raqm-popup .robot-guide-message .step-text {
    font-size: 16px;
    line-height: 1.85;
    color: #111827;
    text-align: start;
    min-height: 1.8em;
    font-weight: 500;
}
.raqm-typed {
    white-space: pre-wrap;
    word-break: break-word;
}
.raqm-popup .robot-guide-typing-cursor {
    height: 18px;
    width: 2px;
    background: #045b52;
    margin-inline-start: 2px;
}
.raqm-popup .robot-guide-step-image {
    width: 100%;
    max-height: 132px;
    object-fit: contain;
    background: #f3f6f6;
    margin: 12px 0 0;
    border-radius: 12px;
}
.raqm-typing-dots {
    display: inline-flex;
    gap: 5px;
    padding: 8px 2px;
}
.raqm-typing-dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #045b52;
    animation: raqm-dot 1s ease-in-out infinite;
}
.raqm-typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.raqm-typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes raqm-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}
.raqm-chat-bubble.speaking {
    box-shadow: 0 0 0 2px rgba(4, 91, 82, 0.18);
}
.raqm-popup .robot-guide-nav {
    margin: 0;
    padding: 12px 16px 16px;
    background: #fff;
    border-top: 1px solid #eef2f2;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 600px) {
    .robot-guide-overlay { padding-bottom: 150px; }
    .robot-guide-container.raqm-popup { max-height: 62vh; }
}

.raqm-chat-row-user { justify-content: flex-end; }
.raqm-chat-bubble.user {
    background: #045b52;
    color: #fff;
    border: 0;
    border-radius: 16px 4px 16px 16px;
    max-width: 85%;
    flex: none;
}
.raqm-popup[dir="rtl"] .raqm-chat-bubble.user {
    border-radius: 4px 16px 16px 16px;
}
.raqm-chat-bubble.user .step-text { color: #fff !important; }
.raqm-chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.raqm-chat-action {
    display: inline-flex;
    align-items: center;
    background: #032425;
    color: #fff !important;
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.raqm-chat-composer {
    padding: 10px 12px 12px;
    background: #fff;
    border-top: 1px solid #eef2f2;
    width: 100%;
    box-sizing: border-box;
}
.raqm-chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
.raqm-chat-chips button {
    border: 1px solid #d7e2e0;
    background: #f4f7f7;
    color: #032425;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.raqm-chat-composer form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.raqm-chat-composer input {
    flex: 1;
    border: 1px solid #d7e2e0;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.raqm-chat-composer .raqm-mic,
.raqm-chat-composer .raqm-send {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}
.raqm-chat-composer .raqm-mic { background: #eef6f5; color: #045b52; font-size: 16px; }
.raqm-chat-composer .raqm-mic.listening {
    background: #ef4444;
    color: #fff;
    animation: raqm-dot 1s ease-in-out infinite;
}
.raqm-chat-composer .raqm-send { background: #045b52; color: #fff; font-size: 16px; }
.raqm-guide-fab {
    position: fixed;
    z-index: 2147480002;
    bottom: 22px;
    inset-inline-end: 22px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: #032425;
    color: #fff;
    box-shadow: 0 12px 30px rgba(3,36,37,.28);
    cursor: pointer;
    font-size: 22px;
}
.raqm-app-overlay.robot-guide-overlay {
    z-index: 2147480090;
    padding: 0 18px 24px;
}
