/* Maya Voice Chatbot - Ultra Compact Modern UI v5.4.0 */

:root {
    --maya-primary: #f83207;
    --maya-primary-dark: #d92b06;
    --maya-primary-light: #ff6b4a;
    --maya-bg: rgba(255, 255, 255, 0.95);
    --maya-bg-glass: rgba(255, 255, 255, 0.85);
    --maya-bg-secondary: #f8fafc;
    --maya-text: #1e293b;
    --maya-text-secondary: #64748b;
    --maya-border: rgba(226, 232, 240, 0.8);
    --maya-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --maya-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.15);
    --maya-radius: 20px;
    --maya-radius-sm: 12px;
}

/* ===== Container ===== */
#maya-chatbot-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    position: fixed;
    z-index: 999999;
}

#maya-chatbot-container.bottom-right {
    bottom: 16px;
    right: 16px;
}

#maya-chatbot-container.bottom-left {
    bottom: 16px;
    left: 16px;
}

/* ===== Toggle Button - Compact ===== */
.maya-toggle-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--maya-primary);
    background: var(--maya-bg);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(248, 50, 7, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 0;
    animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 16px rgba(248, 50, 7, 0.2); }
    50% { transform: scale(1.03); box-shadow: 0 6px 20px rgba(248, 50, 7, 0.28); }
}

.maya-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(248, 50, 7, 0.35);
    animation: none;
}

.maya-toggle-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.maya-toggle-btn.open .maya-toggle-avatar {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

.maya-toggle-btn.open .maya-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.maya-toggle-btn .maya-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0);
    transition: all 0.25s ease;
    color: var(--maya-primary);
}

.maya-toggle-btn .maya-icon-close svg {
    width: 22px;
    height: 22px;
}

.maya-toggle-btn.open {
    animation: none;
}

/* Notification dot - smaller */
.maya-notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: notifPulse 2s ease-in-out infinite;
}

@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===== Chat Window - Ultra Compact with Glassmorphism ===== */
.maya-chat-window {
    position: absolute;
    bottom: 64px;
    width: 280px;
    height: 340px;
    background: var(--maya-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--maya-radius);
    box-shadow: var(--maya-shadow-lg);
    border: 1px solid var(--maya-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.92);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-right .maya-chat-window {
    right: 0;
}

.bottom-left .maya-chat-window {
    left: 0;
}

.maya-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ===== Header - Minimal ===== */
.maya-header {
    background: linear-gradient(135deg, var(--maya-primary) 0%, var(--maya-primary-dark) 100%);
    color: white;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
}

.maya-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.maya-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.maya-header-info h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.maya-header-info p {
    margin: 1px 0 0;
    font-size: 10px;
    opacity: 0.85;
    display: flex;
    align-items: center;
}

.maya-status-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.maya-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.maya-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.maya-close-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== Body - Compact Voice Visual ===== */
.maya-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 12px 8px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.5) 0%, rgba(255, 255, 255, 0.3) 100%);
    gap: 8px;
    min-height: 0;
}

/* Compact Avatar with Pulse */
.maya-avatar-large {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.maya-avatar-large-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--maya-primary);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(248, 50, 7, 0.15);
}

/* Pulse rings */
.maya-pulse-ring {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--maya-primary);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.maya-avatar-large.speaking .maya-pulse-ring {
    animation: pulseRing 1.2s ease-out infinite;
}

.maya-avatar-large.speaking .maya-pulse-ring.delay {
    animation-delay: 0.4s;
}

.maya-avatar-large.listening .maya-pulse-ring {
    animation: pulseRingListen 1.5s ease-out infinite;
    border-color: #22c55e;
}

.maya-avatar-large.listening .maya-pulse-ring.delay {
    animation-delay: 0.5s;
}

.maya-avatar-large.listening .maya-avatar-large-img {
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.maya-avatar-large.processing .maya-avatar-large-img {
    border-color: #f59e0b;
    animation: processingGlow 0.8s ease-in-out infinite;
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes pulseRingListen {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes processingGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.25); }
    50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.4); }
}

/* Voice Status */
.maya-voice-status {
    text-align: center;
}

.maya-voice-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--maya-text);
    letter-spacing: 0.02em;
}

/* Sound Wave Bars - Compact */
.maya-wave-container {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.25s;
}

.maya-wave-container.active,
.maya-wave-container.listening {
    opacity: 1;
}

.maya-wave-bar {
    width: 3px;
    height: 6px;
    border-radius: 2px;
    background: var(--maya-primary);
    transition: background 0.2s;
}

.maya-wave-container.active .maya-wave-bar {
    animation: waveAnim 0.7s ease-in-out infinite;
}

.maya-wave-container.active .maya-wave-bar:nth-child(1) { animation-delay: 0s; }
.maya-wave-container.active .maya-wave-bar:nth-child(2) { animation-delay: 0.08s; }
.maya-wave-container.active .maya-wave-bar:nth-child(3) { animation-delay: 0.16s; }
.maya-wave-container.active .maya-wave-bar:nth-child(4) { animation-delay: 0.24s; }
.maya-wave-container.active .maya-wave-bar:nth-child(5) { animation-delay: 0.32s; }

.maya-wave-container.listening .maya-wave-bar {
    background: #22c55e;
    animation: waveAnimListen 0.9s ease-in-out infinite;
}

.maya-wave-container.listening .maya-wave-bar:nth-child(1) { animation-delay: 0s; }
.maya-wave-container.listening .maya-wave-bar:nth-child(2) { animation-delay: 0.12s; }
.maya-wave-container.listening .maya-wave-bar:nth-child(3) { animation-delay: 0.24s; }
.maya-wave-container.listening .maya-wave-bar:nth-child(4) { animation-delay: 0.36s; }
.maya-wave-container.listening .maya-wave-bar:nth-child(5) { animation-delay: 0.48s; }

@keyframes waveAnim {
    0%, 100% { height: 6px; }
    50% { height: 16px; }
}

@keyframes waveAnimListen {
    0%, 100% { height: 5px; }
    50% { height: 14px; }
}

/* ===== Transcript Area - Compact ===== */
.maya-transcript-area {
    width: 100%;
    min-height: 36px;
    max-height: 50px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.maya-transcript-box {
    font-size: 11px;
    line-height: 1.4;
    color: var(--maya-text-secondary);
    text-align: center;
    padding: 6px 10px;
    border-radius: var(--maya-radius-sm);
    max-height: 44px;
    overflow-y: auto;
    width: 100%;
    display: none;
    animation: fadeInUp 0.25s ease;
}

.maya-transcript-box.bot {
    background: rgba(248, 50, 7, 0.05);
    color: var(--maya-text);
    border: 1px solid rgba(248, 50, 7, 0.1);
}

.maya-transcript-box.user {
    background: rgba(34, 197, 94, 0.05);
    color: var(--maya-text);
    border: 1px solid rgba(34, 197, 94, 0.1);
}

.maya-transcript-box.system {
    background: rgba(245, 158, 11, 0.06);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.12);
}

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

/* ===== Footer - Minimal ===== */
.maya-footer {
    padding: 8px 12px 10px;
    border-top: 1px solid var(--maya-border);
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.5);
}

/* ===== Mic Button - Compact ===== */
.maya-mic-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--maya-primary) 0%, var(--maya-primary-dark) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(248, 50, 7, 0.3);
}

.maya-mic-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(248, 50, 7, 0.4);
}

.maya-mic-btn:active {
    transform: scale(0.95);
}

.maya-mic-btn svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 2;
}

/* Mic Pulse */
.maya-mic-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.2);
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

/* Listening state */
.maya-mic-btn.listening {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.maya-mic-btn.listening .maya-mic-pulse {
    opacity: 1;
    animation: micPulse 1.2s ease-out infinite;
}

@keyframes micPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

/* Disabled state */
.maya-mic-btn.disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

.maya-mic-btn.disabled:hover {
    transform: none;
}

.maya-mic-label {
    font-size: 10px;
    color: var(--maya-text-secondary);
    margin: 0;
    font-weight: 500;
}

.maya-powered {
    margin: 0;
    font-size: 9px;
    color: var(--maya-text-secondary);
    opacity: 0.6;
}

/* ===== Mobile - Ultra Compact ===== */
@media (max-width: 480px) {
    #maya-chatbot-container.bottom-right,
    #maya-chatbot-container.bottom-left {
        bottom: 12px;
        right: 12px;
        left: auto;
    }

    .maya-chat-window {
        width: 260px;
        height: 300px;
        bottom: 58px;
    }

    .bottom-right .maya-chat-window {
        right: 0;
    }

    .bottom-left .maya-chat-window {
        left: 0;
    }

    .maya-header {
        padding: 8px 10px;
        gap: 6px;
    }

    .maya-avatar {
        width: 28px;
        height: 28px;
    }

    .maya-header-info h3 {
        font-size: 12px;
    }

    .maya-header-info p {
        font-size: 9px;
    }

    .maya-close-btn {
        width: 22px;
        height: 22px;
        top: 6px;
        right: 6px;
    }

    .maya-close-btn svg {
        width: 12px;
        height: 12px;
    }

    .maya-body {
        padding: 10px 10px 6px;
        gap: 6px;
    }

    .maya-avatar-large {
        width: 52px;
        height: 52px;
    }

    .maya-avatar-large-img {
        width: 46px;
        height: 46px;
    }

    .maya-pulse-ring {
        width: 46px;
        height: 46px;
    }

    .maya-voice-label {
        font-size: 10px;
    }

    .maya-wave-container {
        height: 14px;
        gap: 2px;
    }

    .maya-wave-bar {
        width: 2px;
        height: 5px;
    }

    .maya-transcript-area {
        min-height: 32px;
        max-height: 42px;
    }

    .maya-transcript-box {
        font-size: 10px;
        max-height: 38px;
        padding: 5px 8px;
    }

    .maya-footer {
        padding: 6px 10px 8px;
        gap: 3px;
    }

    .maya-mic-btn {
        width: 36px;
        height: 36px;
    }

    .maya-mic-btn svg {
        width: 18px;
        height: 18px;
    }

    .maya-mic-pulse {
        width: 36px;
        height: 36px;
    }

    .maya-mic-label {
        font-size: 9px;
    }

    .maya-powered {
        font-size: 8px;
    }

    .maya-toggle-btn {
        width: 46px;
        height: 46px;
    }

    .maya-toggle-btn .maya-icon-close svg {
        width: 18px;
        height: 18px;
    }

    .maya-notification-dot {
        width: 8px;
        height: 8px;
    }
}

/* ===== Extra Small Screens ===== */
@media (max-width: 360px) {
    .maya-chat-window {
        width: 240px;
        height: 280px;
    }

    .maya-avatar-large {
        width: 46px;
        height: 46px;
    }

    .maya-avatar-large-img {
        width: 40px;
        height: 40px;
    }

    .maya-pulse-ring {
        width: 40px;
        height: 40px;
    }

    .maya-mic-btn {
        width: 34px;
        height: 34px;
    }

    .maya-mic-btn svg {
        width: 16px;
        height: 16px;
    }

    .maya-toggle-btn {
        width: 42px;
        height: 42px;
    }
}

/* ===== Accessibility ===== */
.maya-close-btn:focus,
.maya-toggle-btn:focus,
.maya-mic-btn:focus {
    outline: 2px solid var(--maya-primary);
    outline-offset: 2px;
}

/* Scrollbar - Minimal */
.maya-transcript-box::-webkit-scrollbar {
    width: 3px;
}

.maya-transcript-box::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 2px;
}

.maya-transcript-box::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

/* ===== Phone Input Form - Compact ===== */
.maya-phone-form {
    width: 100%;
    padding: 0 4px;
    animation: fadeInUp 0.3s ease;
}

.maya-phone-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--maya-text);
    margin-bottom: 6px;
    text-align: center;
}

.maya-phone-row {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.maya-country-select {
    width: 90px;
    flex-shrink: 0;
    padding: 8px 4px;
    font-size: 11px;
    border: 1px solid var(--maya-border);
    border-radius: 8px;
    background: var(--maya-bg);
    color: var(--maya-text);
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 18px;
}

.maya-country-select:focus {
    border-color: var(--maya-primary);
    outline: none;
}

.maya-phone-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid var(--maya-border);
    border-radius: 8px;
    background: var(--maya-bg);
    color: var(--maya-text);
    transition: border-color 0.2s;
    font-family: inherit;
}

.maya-phone-input:focus {
    border-color: var(--maya-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(248, 50, 7, 0.1);
}

.maya-phone-input::placeholder {
    color: var(--maya-text-secondary);
    font-size: 12px;
}

.maya-phone-input.maya-input-error {
    border-color: #ef4444;
    animation: shake 0.35s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.maya-dial-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: linear-gradient(135deg, var(--maya-primary) 0%, var(--maya-primary-dark) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(248, 50, 7, 0.25);
}

.maya-dial-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(248, 50, 7, 0.35);
}

.maya-dial-btn:active {
    transform: translateY(0);
}

.maya-dial-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile Phone Form */
@media (max-width: 480px) {
    .maya-phone-label {
        font-size: 10px;
        margin-bottom: 5px;
    }

    .maya-phone-row {
        gap: 3px;
        margin-bottom: 6px;
    }

    .maya-country-select {
        width: 80px;
        padding: 6px 3px;
        font-size: 10px;
        padding-right: 16px;
    }

    .maya-phone-input {
        padding: 6px 8px;
        font-size: 13px;
    }

    .maya-phone-input::placeholder {
        font-size: 11px;
    }

    .maya-dial-btn {
        padding: 8px 10px;
        font-size: 12px;
        gap: 5px;
    }

    .maya-dial-btn svg {
        width: 14px;
        height: 14px;
    }
}
