/* AI Assistant Frontend Styles */
#aicg-visitor-assistant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#aicg-visitor-assistant .aicg-visitor-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row-reverse;
}

#aicg-visitor-voice-btn,
#aicg-visitor-keyboard-btn {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    box-shadow: 0 8px 24px rgba(19, 94, 150, 0.3);
}

#aicg-visitor-voice-btn {
    width: 60px;
    height: 60px;
}

#aicg-visitor-keyboard-btn {
    width: 36px;
    height: 36px;
    background: #fff;
    color: #2271b1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#aicg-visitor-voice-btn:hover,
#aicg-visitor-keyboard-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(19, 94, 150, 0.4);
}

#aicg-visitor-voice-btn.recording {
    background: #d63638;
    animation: aicg-pulse 1.2s infinite;
}

#aicg-visitor-voice-btn.active-standby {
    box-shadow: 0 0 15px rgba(34, 113, 177, 0.6);
    border: 2px solid #fff;
}


#aicg-visitor-voice-btn .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
}

#aicg-visitor-keyboard-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}


#aicg-visitor-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    display: none;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.aicg-chat-header {
    background: #2271b1;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aicg-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#aicg-chat-close {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
}

#aicg-chat-close:hover {
    opacity: 1;
}

.aicg-chat-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    background: #f9fafb;
}

.aicg-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 85%;
}

.aicg-message.assistant {
    background: #fff;
    color: #374151;
    border-bottom-left-radius: 2px;
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.aicg-message.user {
    background: #2271b1;
    color: #fff;
    border-bottom-right-radius: 2px;
    margin-left: auto;
}

.aicg-chat-footer {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #f0f0f1;
    display: flex;
    gap: 8px;
}

#aicg-visitor-input {
    flex: 1;
    border: 1px solid #dcdcde;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
}

#aicg-visitor-send,
#aicg-visitor-inner-mic {
    background: #2271b1;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#aicg-visitor-inner-mic.recording {
    background: #d63638;
    animation: aicg-pulse 1.2s infinite;
}

.aicg-status-indicator {
    position: absolute;
    bottom: 0;
    right: 75px;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    color: #444;
    white-space: nowrap;
    display: none;
    border: 1px solid #eee;
    z-index: 1000;
}

.aicg-status-indicator.active {
    display: block;
    animation: aicg-fade-in 0.3s ease;
}

@keyframes aicg-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aicg-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(214, 54, 56, 0.7);
        transform: scale(0.95);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(214, 54, 56, 0);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(214, 54, 56, 0);
        transform: scale(0.95);
    }
}

@keyframes aicg-border-pulse {
    0% {
        box-shadow: 0 0 0 0px rgba(34, 113, 177, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(34, 113, 177, 0);
    }
    100% {
        box-shadow: 0 0 0 0px rgba(34, 113, 177, 0);
    }
}


#aicg-processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    flex-direction: column;
}

#aicg-processing-overlay.active {
    display: flex;
}

.aicg-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2271b1;
    border-radius: 50%;
    animation: aicg-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes aicg-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.aicg-processing-text {
    font-weight: 500;
    color: #2271b1;
    font-size: 16px;
}

/* DOM Focus Highlight */
.aicg-focus-highlight {
    border: 2px solid rgba(34, 113, 177, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(34, 113, 177, 0.03);
    animation: aicg-border-pulse 1s ease-in-out 3;
    position: relative;
    z-index: 10;
}

/* Navigation Modal Styles */
.aicg-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.aicg-nav-overlay.active {
    visibility: visible;
    opacity: 1;
}

.aicg-nav-modal {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.aicg-nav-overlay.active .aicg-nav-modal {
    transform: translateY(0);
}

.aicg-nav-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.aicg-nav-primary {
    background: #f0f7ff;
    border: 1px solid #c2e0ff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.aicg-nav-primary h4 {
    margin: 0 0 10px 0;
}

.aicg-nav-primary p {
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #3c434a;
}

.aicg-nav-others h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    opacity: 0.7;
}

.aicg-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aicg-nav-list li {
    margin-bottom: 8px;
}

.aicg-nav-list a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.aicg-nav-list a:hover {
    text-decoration: underline;
}

.aicg-nav-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

#aicg-nav-confirm {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

#aicg-nav-cancel {
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

.aicg-nav-score {
    font-size: 0.8em;
    font-weight: normal;
    background: rgba(0, 128, 0, 0.1);
    color: green;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
    vertical-align: middle;
}

.aicg-nav-score-small {
    font-size: 0.7em;
    color: #666;
    margin-left: 5px;
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 4px;
}