/* KX Guide Widget Styles */

/* Floating Button */
/* Floating Button (Now Voice Trigger) */
/* Floating Button (Ask Beon Trigger) */
.kx-guide-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2147483647;
    text-align: center;
    padding: 0;
    overflow: hidden;
}

.kx-guide-btn:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: none;
}

.kx-guide-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* Active Mode (When Panel is Open) */
.kx-guide-btn.active-mode {
    bottom: 90px !important;
    transform: translateX(-50%) scale(0.5) !important;
    /* Shrink effect */
    opacity: 0 !important;
    /* Hide */
    pointer-events: none !important;
    /* Disable clicks */
    visibility: hidden !important;
    /* Ensure screen readers ignore */
    transition: all 0.3s ease !important;
}

/* "Ask Beon" Text styling */
.kx-guide-btn span.beon-text {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
}

.kx-guide-btn svg {
    display: none;
    /* Hide default icon */
}

/* Pulse Animation */
/* Pulse Animation Ring */
.kx-guide-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    pointer-events: none;
    display: none;
    /* Hidden by default */
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 255, 65, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Guide Panel - Footer Bar Mode */
.kx-guide-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.8);
    /* 80% Opacity */
    border-top: 1px solid #333;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 2147483646;
    /* Behind trigger button */
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(100%);
    /* Hidden by default */
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);

    /* Ensure text is readable */
    font-family: 'Inter', sans-serif;
}

.kx-guide-panel.active {
    transform: translateY(0);
    /* Slide up */
}

/* Left Controls */
.kx-bar-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.kx-close-btn {
    background: transparent;
    border: 1px solid #03ff00;
    border-radius: 20px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.kx-close-btn span.x-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #00ff88;
    font-size: 10px;
    transition: all 0.3s ease;
}

.kx-close-btn:hover {
    border-color: rgba(0, 255, 65, 0.3);
    color: #fff;
    background: rgba(0, 255, 65, 0.05);
}

.kx-close-btn:hover span.x-icon {
    background: #00ff41;
    color: #000;
    transform: rotate(90deg);
}

.kx-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: color 0.3s;
}

.kx-toggle-wrapper:hover {
    color: #fff;
}

/* Toggle Switch */
.kx-toggle-switch {
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.kx-toggle-switch.on {
    background: rgba(0, 255, 65, 0.2);
    border-color: #00ff41;
}

.kx-toggle-knob {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.kx-toggle-switch.on .kx-toggle-knob {
    transform: translateX(18px);
    background: #00ff41;
    box-shadow: 0 0 10px #00ff41;
}

/* Center Input Area */
.kx-bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}

.kx-input-wrapper {
    position: relative;
    width: 100%;
    pointer-events: auto;
}

.kx-text-input {
    width: 100%;
    height: 60px;
    border-radius: 50px !important;
    padding-left: 24px !important;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid #00ff41;
    border-radius: 100px;
    padding: 0 70px 0 32px;
    color: #fff !important;
    font-size: 16px;
    letter-spacing: 0.5px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.05),
        0 4px 20px rgba(0, 0, 0, 0.4);
}

.kx-text-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 1px;
}

.kx-text-input:focus {
    background: rgba(0, 0, 0, 0.8);
    border-color: #00ff41;
}

/* Mic Button inside Input */
.kx-input-mic {
    position: absolute;
    right: 5px;
    top: 49%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    background: #00ff41;
    border: 4px solid #1e5322 !important;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    padding: 0.6em 0.6em 0.4em;
}

.kx-input-mic:hover {
    background: #00ff41;
    animation: none;
}

/* Send Button Mode */
.kx-input-mic.kx-input-send {
    background: #00ff41;
    animation: none;
}

.kx-input-mic.kx-input-send:hover {
    transform: translateY(-50%) scale(1.1);
    background: #33ff66;
}

.kx-input-mic svg {
    width: 48px !important;
    height: 48px !important;
    stroke-width: 2.2px;
}

@keyframes kx-pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 65, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0);
    }
}

/* Response Area (Visible if Toggled) */
.kx-response-overlay {
    position: fixed;
    bottom: 120px;
    /* Above bar */
    left: 0;
    width: 100%;
    pointer-events: none;
    visibility: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 2147483645;
}

.kx-response-text {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    border-radius: 12px;
    color: #fff;
    max-width: 600px;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.kx-response-text.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    .kx-guide-panel {
        flex-direction: column !important;
        height: auto !important;
        min-height: 180px;
        padding: 15px 20px 25px 20px !important;
        gap: 12px !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        bottom: 0 !important;
        border-radius: 20px 20px 0 0;
    }

    .kx-bar-left {
        width: 100% !important;
        justify-content: center !important;
        /* Center buttons on mobile */
        gap: 20px !important;
        order: 2;
        /* Move below center */
        margin-top: 10px;
    }

    .kx-bar-center {
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        order: 1;
        /* Move above left */
    }

    .kx-input-wrapper {
        margin-top: 25px;
    }

    .kx-text-input {
        height: 54px !important;
        font-size: 14px !important;
    }

    .kx-response-card {
        bottom: calc(100% + 15px) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 94% !important;
        max-width: none !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
        padding: 20px !important;
        border-radius: 20px !important;
        top: auto !important;
        /* Remove the fixed top offset */
    }

    .kx-decorative-circle {
        top: -45px !important;
        width: 50px !important;
        height: 50px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .kx-guide-btn {
        bottom: 20px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 64px !important;
        height: 64px !important;
    }

    .kx-guide-btn:hover {
        transform: scale(1.05) !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .kx-guide-panel {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .kx-guide-header {
        border-bottom-color: #374151;
    }

    .kx-guide-header h3 {
        color: #f3f4f6;
    }

    #kx-guide-close {
        color: #9ca3af;
    }

    #kx-guide-close:hover {
        background: #374151;
        color: #f3f4f6;
    }

    .kx-guide-status {
        background: #111827;
    }

    #kx-status-text {
        color: #9ca3af;
    }

    .kx-guide-intro {
        color: #d1d5db;
    }

    #kx-guide-suggestions p {
        color: #f3f4f6;
    }

    .kx-suggestion {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }

    .kx-suggestion:hover {
        background: #4b5563;
        border-color: #667eea;
        color: #667eea;
    }

    .kx-guide-footer {
        border-top-color: #374151;
    }
}

/* Decorative Circle above Input */
.kx-decorative-circle {
    margin-top: 0px;
    width: 60px;
    height: 60px;
    background: #000;
    border-radius: 50%;
    position: absolute;
    top: -4px;
    /* Top edge of the response card */
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    z-index: 20;
    pointer-events: none;
    /* purely decorative */
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kx-guide-panel.active .kx-decorative-circle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition-delay: 0.1s;
    overflow: hidden;
    /* Ensure video stays circular */
}

/* Move to bottom when conversation starts */
.kx-guide-panel.conversation-active .kx-decorative-circle {
    top: 100%;
    margin-top: 10px;
}

.kx-decorative-circle video {
    width: 104%;
    /* Slight overshoot to hide edge gaps */
    height: 104%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

/* Response Card (Floating Above Circle) */
.kx-response-card {
    position: absolute;
    bottom: 100px;
    /* Above the input bar + circle */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: bottom center;
}

.kx-guide-panel.active .kx-response-card.visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    bottom: 110px;
    /* Slide up slightly */
}

/* Card Text Content */
.text-center {
    text-align: center;
}

.kx-intro-highlight {
    color: #03ff00;
    /* Light green color from the image */
    font-size: 18px;
    font-weight: 500;
}

.kx-card-content {
    padding-top: 10px;
}

.kx-card-content p {
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 16px 0;
    font-weight: 400;
}

.kx-card-content p:last-child {
    margin-bottom: 0;
}

.kx-card-content ul {
    margin: 12px 0 16px 20px;
    padding: 0;
    list-style-type: none;
    text-align: left;
}

p#kx-card-text em {
    font-style: normal;
}

.kx-card-content li {
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 8px;
    position: relative;
    padding-left: 18px;
}

.kx-card-content li::before {
    content: "•";
    color: #00ff41;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.kx-card-content strong {
    color: #00ff41;
    font-weight: 600;
}

/* Card Options (Buttons) */
.kx-card-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kx-option-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 12px 24px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    text-align: center;
}

.kx-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00ff41;
    transform: translateX(5px);
}

.kx-option-btn .arrow {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
    display: none;
}

.kx-option-btn:hover .arrow {
    color: #00ff41;
}

/* Plan Execution List */
.kx-plan-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.kx-plan-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.kx-plan-item.active {
    background: rgba(0, 255, 65, 0.1);
    border-color: rgba(0, 255, 65, 0.3);
    color: #fff;
}

.kx-plan-item.completed {
    background: rgba(0, 0, 0, 0.3);
    color: #00ff41;
    /* Green text for completion */
    border-color: transparent;
}

.kx-plan-item .status-icon {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s;
}

.kx-plan-item.active .status-icon {
    border-color: #00ff41;
    border-top-color: transparent;
    animation: kx-spin 1s linear infinite;
}

.kx-plan-item.completed .status-icon {
    background: #00ff41;
    border-color: #00ff41;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kx-plan-item.completed .status-icon::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

@keyframes kx-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Follow-up Hint Text */
.kx-followup-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin: 0 0 8px 4px;
    font-style: italic;
}

/* Scrollable Plan List */
.kx-plan-list {
    max-height: 200px;
    /* Restrict height */
    overflow-y: auto;
    /* Enable vertical scroll */
    padding-right: 5px;
    /* Space for scrollbar */
}

/* Custom Scrollbar for Plan List */
.kx-plan-list::-webkit-scrollbar {
    width: 6px;
}

.kx-plan-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.kx-plan-list::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 65, 0.3);
    border-radius: 3px;
}

.kx-plan-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 65, 0.6);
}