/* Enhanced AI Chat Interface - Fixed Layout */
:root {
    --black-primary: #000000;
    --black-secondary: #111111;
    --black-tertiary: #1a1a1a;
    --black-light: #222222;
    --white-primary: #ffffff;
    --white-secondary: #f8f8f8;
    --white-tertiary: #f0f0f0;
    --gray-dark: #333333;
    --gray-medium: #666666;
    --gray-light: #999999;
    --border-light: rgba(255, 255, 255, 0.1);
    --border-dark: rgba(0, 0, 0, 0.1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-black: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-white: 0 10px 40px rgba(255, 255, 255, 0.1);
}

/* ===== CRITICAL FIX: CONTAIN PANELS ===== */
.ai-chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 520px;
    background: var(--black-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-black);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition-smooth);
    overflow: hidden;
}

body.light-theme .ai-chat-container {
    background: var(--white-primary);
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-white);
}

.ai-chat-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* FIX: Settings and History panels INSIDE chat container */
.settings-panel,
.history-panel {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--black-primary);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

body.light-theme .settings-panel,
body.light-theme .history-panel {
    background: var(--white-primary);
}

.settings-panel.show,
.history-panel.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
}

/* Enhanced Navigation AI Button */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-ai-assistant {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--black-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--white-primary);
}

body.light-theme .nav-ai-assistant {
    background: var(--white-primary);
    border: 1px solid var(--border-dark);
    color: var(--black-primary);
}

.nav-ai-assistant:hover {
    transform: scale(1.1);
    border-color: var(--white-primary);
}

body.light-theme .nav-ai-assistant:hover {
    border-color: var(--black-primary);
}

.nav-ai-assistant .fas {
    font-size: 18px;
}

/* Enhanced Chat Header */
.ai-chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--black-secondary);
    flex-shrink: 0;
}

body.light-theme .ai-chat-header {
    background: var(--white-secondary);
    border-bottom: 1px solid var(--border-dark);
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--black-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--white-primary);
    transition: var(--transition-smooth);
    border: 1px solid var(--border-light);
}

body.light-theme .ai-avatar {
    background: var(--black-primary);
    color: var(--white-primary);
}

.ai-info h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--white-primary);
    margin: 0;
}

body.light-theme .ai-info h3 {
    color: var(--black-primary);
}

.ai-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ff00;
    animation: statusPulse 2s infinite;
}

.status-text {
    font-size: 10px;
    color: var(--gray-light);
    font-weight: 500;
}

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

/* Header Action Buttons */
.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
}

body.light-theme .header-btn {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

/* FIX: Header buttons hover - translucent effect */
.header-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    border-color: rgba(255, 255, 255, 0.2);
}

body.light-theme .header-btn:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.2);
}

/* Enhanced Chat Messages */
.ai-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 10px;
    opacity: 0.3;
}

.ai-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.ai-message-bot .message-avatar {
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-light);
}

.ai-message-user .message-avatar {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-light);
}

body.light-theme .ai-message-user .message-avatar {
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-dark);
}

.message-content {
    flex: 1;
    background: var(--black-secondary);
    padding: 10px 12px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    color: var(--white-primary);
    border: 1px solid var(--border-light);
    max-width: 85%;
}

body.light-theme .ai-message-bot .message-content {
    background: var(--white-secondary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

.ai-message-user {
    justify-content: flex-end;
}

.ai-message-user .message-content {
    background: var(--white-primary);
    color: var(--black-primary);
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 12px;
    border: 1px solid var(--border-light);
}

body.light-theme .ai-message-user .message-content {
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-dark);
}

.message-content p {
    margin: 0 0 6px 0;
    line-height: 1.4;
    font-size: 12px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
}

.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.message-time {
    font-size: 9px;
    color: var(--gray-light);
    font-weight: 500;
}

.speak-btn {
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    font-size: 10px;
    padding: 3px;
    border-radius: 3px;
    transition: var(--transition-fast);
}

.speak-btn:hover {
    color: var(--white-primary);
    background: var(--gray-dark);
}

body.light-theme .speak-btn:hover {
    background: var(--gray-light);
    color: var(--black-primary);
}

/* Quick Actions Container */
.quick-actions-container {
    border-top: 1px solid var(--border-light);
    background: var(--black-secondary);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

body.light-theme .quick-actions-container {
    background: var(--white-secondary);
    border-top: 1px solid var(--border-dark);
}

.quick-actions-container.hidden {
    display: none;
}

.quick-actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-light);
}

body.light-theme .quick-actions-header {
    border-bottom: 1px solid var(--border-dark);
}

.quick-actions-header span {
    font-size: 10px;
    color: var(--gray-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-actions-toggle {
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    font-size: 9px;
    padding: 3px;
    transition: var(--transition-fast);
}

.quick-actions-toggle:hover {
    color: var(--white-primary);
}

body.light-theme .quick-actions-toggle:hover {
    color: var(--black-primary);
}

.quick-actions-scrollable {
    display: flex;
    gap: 5px;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quick-actions-scrollable::-webkit-scrollbar {
    display: none;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 55px;
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 500;
    text-align: center;
}

body.light-theme .quick-btn {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

/* FIX: Quick buttons hover - translucent effect */
.quick-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

body.light-theme .quick-btn:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.2);
}

.quick-btn i {
    font-size: 11px;
}

/* Enhanced Chat Input - FIXED COLORS */
.chat-input-container {
    padding: 10px 12px;
    border-top: 1px solid var(--border-light);
    background: var(--black-secondary);
    flex-shrink: 0;
}

body.light-theme .chat-input-container {
    background: var(--white-secondary);
    border-top: 1px solid var(--border-dark);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

/* TRANSLUCENT SEARCH BAR */
.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(20px);
    color: var(--white-primary);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    padding: 10px 45px 10px 12px;
    font-size: 12px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
    outline: none;
    resize: none;
    max-height: 80px;
    min-height: 40px;
    line-height: 1.4;
    transition: var(--transition-fast);
}

body.light-theme .chat-input {
    background: rgba(255, 255, 255, 0.4) !important;
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

.chat-input:focus {
    border-color: var(--white-primary);
    background: rgba(0, 0, 0, 0.6) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

body.light-theme .chat-input:focus {
    border-color: var(--black-primary);
    background: rgba(255, 255, 255, 0.6) !important;
}

.input-actions {
    position: absolute;
    right: 6px;
    bottom: 6px;
    display: flex;
    gap: 5px;
    align-items: center;
}


/* UPDATED VOICE BUTTON - MATCHES OTHER BUTTONS */
.voice-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px !important; /* Changed from circle to match other buttons */
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 10px;
    backdrop-filter: blur(10px);
}

body.light-theme .voice-btn {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

/* Voice button hover - matches other buttons */
.voice-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(15px);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

body.light-theme .voice-btn:hover {
    background: rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(0, 0, 0, 0.3);
}

.voice-btn.recording {
    background: #ff4444 !important;
    color: var(--white-primary) !important;
    border-color: #ff4444 !important;
    animation: recordingPulse 1s infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        background: #ff4444;
        transform: scale(1);
    }
    50% {
        background: #ff6666;
        transform: scale(1.05);
    }
}

/* Send Button - UPDATED TO MATCH THEME */
.send-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px !important;
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 10px;
    backdrop-filter: blur(10px);
}

body.light-theme .send-btn {
    background: var(--black-primary);
    color: var(--white-primary);
}

.send-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(15px);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

body.light-theme .send-btn:hover {
    background: rgba(0, 0, 0, 0.15) !important;
    border-color: rgba(0, 0, 0, 0.3);
}

/* Enhanced Thinking Animation */
.thinking-bubble {
    position: absolute;
    bottom: 60px;
    left: 12px;
    right: 12px;
    background: var(--black-primary);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 8px 10px;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-heavy);
    z-index: 1;
    backdrop-filter: blur(20px);
}
/* Enhanced Thinking Animation */
.thinking-bubble {
    position: absolute;
    bottom: 60px;
    left: 12px;
    right: 12px;
    background: var(--black-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px 10px;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-black);
    z-index: 1;
}

body.light-theme .thinking-bubble {
    background: var(--white-tertiary);
    border: 1px solid var(--border-dark);
}

.thinking-bubble.show {
    display: flex;
}

.thinking-dots {
    display: flex;
    gap: 3px;
}

.thinking-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gray-light);
    animation: thinkingDots 1.4s ease-in-out infinite both;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes thinkingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.thinking-text {
    color: var(--white-primary);
    font-size: 11px;
    font-weight: 500;
    font-family: 'Rajdhani', sans-serif;
}

body.light-theme .thinking-text {
    color: var(--black-primary);
}

/* Settings Panel Headers */
.settings-header,
.history-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--black-secondary);
    flex-shrink: 0;
}

body.light-theme .settings-header,
body.light-theme .history-header {
    background: var(--white-secondary);
    border-bottom: 1px solid var(--border-dark);
}

.settings-header h4,
.history-header h4 {
    color: var(--white-primary);
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

body.light-theme .settings-header h4,
body.light-theme .history-header h4 {
    color: var(--black-primary);
}

.close-panel-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 11px;
}

body.light-theme .close-panel-btn {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

/* FIX: Close panel button hover - translucent effect */
.close-panel-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
}

body.light-theme .close-panel-btn:hover {
    background: rgba(0, 0, 0, 0.1) !important;
}

.settings-content,
.history-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.setting-section {
    margin-bottom: 16px;
}

.setting-section h5 {
    color: var(--white-primary);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.light-theme .setting-section h5 {
    color: var(--black-primary);
}

/* Model Selection in Settings */
.model-selection {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.model-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

body.light-theme .model-option {
    border: 1px solid var(--border-dark);
}

/* FIX: Model option hover and active - translucent effect */
.model-option:hover,
.model-option.active {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(10px);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.light-theme .model-option:hover,
body.light-theme .model-option.active {
    background: rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
}

.model-option .model-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--white-primary);
    background: var(--black-primary);
}

body.light-theme .model-option .model-avatar {
    background: var(--black-primary);
    color: var(--white-primary);
}

.model-option.active .model-avatar {
    background: var(--black-primary);
    color: var(--white-primary);
}

body.light-theme .model-option.active .model-avatar {
    background: var(--black-primary);
    color: var(--white-primary);
}

.model-info {
    flex: 1;
}

.model-name {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: var(--white-primary);
}

body.light-theme .model-name {
    color: var(--black-primary);
}

.model-option.active .model-name {
    color: var(--white-primary);
}

body.light-theme .model-option.active .model-name {
    color: var(--black-primary);
}

.model-description {
    display: block;
    font-size: 10px;
    color: var(--gray-light);
    margin-top: 2px;
}

.setting-item {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--white-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

body.light-theme .setting-item label {
    color: var(--black-primary);
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    background: var(--black-primary);
    position: relative;
    transition: var(--transition-fast);
}

body.light-theme .checkbox-custom {
    background: var(--white-primary);
    border: 1px solid var(--border-dark);
}

input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--white-primary);
    border-color: var(--white-primary);
}

body.light-theme input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--black-primary);
    border-color: var(--black-primary);
}

input[type="checkbox"]:checked + .checkbox-custom::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--black-primary);
    font-size: 9px;
    font-weight: bold;
}

body.light-theme input[type="checkbox"]:checked + .checkbox-custom::after {
    color: var(--white-primary);
}

input[type="checkbox"] {
    display: none;
}

input[type="range"] {
    flex: 1;
    margin: 0 6px;
    appearance: none;
    height: 3px;
    background: var(--gray-dark);
    border-radius: 2px;
    outline: none;
}

body.light-theme input[type="range"] {
    background: var(--gray-light);
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--white-primary);
    border-radius: 50%;
    cursor: pointer;
}

body.light-theme input[type="range"]::-webkit-slider-thumb {
    background: var(--black-primary);
}

.range-value {
    color: var(--white-primary);
    font-weight: 500;
    font-size: 10px;
    min-width: 22px;
}

body.light-theme .range-value {
    color: var(--black-primary);
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-btn {
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-light);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: var(--transition-fast);
    font-size: 11px;
}

body.light-theme .setting-btn {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

/* FIX: Setting buttons hover - translucent effect */
.setting-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
}

body.light-theme .setting-btn:hover {
    background: rgba(0, 0, 0, 0.1) !important;
}

.setting-note {
    margin-top: 8px;
}

.setting-note small {
    color: var(--gray-light);
    font-size: 10px;
    font-style: italic;
}

/* Voice Recording Overlay */
.voice-recording-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

body.light-theme .voice-recording-overlay {
    background: rgba(255, 255, 255, 0.8);
}

.voice-recording-overlay.show {
    display: flex;
}

.recording-container {
    background: var(--black-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    max-width: 300px;
    width: 90%;
}

body.light-theme .recording-container {
    background: var(--white-primary);
    border: 1px solid var(--border-dark);
}

.recording-header {
    margin-bottom: 15px;
}

.recording-header i {
    font-size: 28px;
    color: var(--gray-light);
    margin-bottom: 8px;
}

.recording-header h3 {
    color: var(--white-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

body.light-theme .recording-header h3 {
    color: var(--black-primary);
}

.recording-visualization {
    margin-bottom: 15px;
}

.sound-waves {
    display: flex;
    justify-content: center;
    gap: 2px;
}

.wave {
    width: 2px;
    height: 16px;
    background: var(--gray-light);
    border-radius: 1px;
    animation: waveMotion 1.2s ease-in-out infinite;
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.3s; }
.wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveMotion {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.5); }
}

.recording-timer {
    font-family: "JetBrains Mono", monospace;
    font-size: 20px;
    font-weight: 600;
    color: var(--white-primary);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

body.light-theme .recording-timer {
    color: var(--black-primary);
}

.recording-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.recording-action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
    border: 1px solid;
    font-size: 12px;
}

.stop-btn {
    background: var(--gray-medium);
    color: var(--white-primary);
    border-color: var(--gray-medium);
}

.stop-btn:hover {
    background: var(--gray-light);
    transform: scale(1.05);
}

.cancel-btn {
    background: var(--black-primary);
    color: var(--white-primary);
    border-color: var(--border-light);
}

body.light-theme .cancel-btn {
    background: var(--white-primary);
    color: var(--black-primary);
    border-color: var(--border-dark);
}

.cancel-btn:hover {
    background: var(--white-primary);
    color: var(--black-primary);
}

body.light-theme .cancel-btn:hover {
    background: var(--black-primary);
    color: var(--white-primary);
}

/* AI Assistant Button */
.ai-assistant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--black-primary);
    color: var(--white-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition-smooth);
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.light-theme .ai-assistant {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

.ai-assistant:hover {
    transform: scale(1.1);
    border-color: var(--white-primary);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

body.light-theme .ai-assistant:hover {
    border-color: var(--black-primary);
}

.ai-tooltip {
    position: absolute;
    bottom: 65px;
    right: 0;
    background: var(--black-primary);
    color: var(--white-primary);
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-light);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
}

body.light-theme .ai-tooltip {
    background: var(--white-primary);
    color: var(--black-primary);
    border: 1px solid var(--border-dark);
}

.ai-assistant:hover .ai-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-3px);
}

/* History Panel Styles */
.history-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid var(--border-light);
}

body.light-theme .history-item {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-dark);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.light-theme .history-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.history-time {
    font-size: 10px;
    color: var(--gray-light);
    margin-bottom: 4px;
}

.history-preview {
    font-size: 12px;
    color: var(--white-primary);
}

body.light-theme .history-preview {
    color: var(--black-primary);
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-light);
}

.history-empty i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-ai-assistant {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--black-primary);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--white-primary);
}

body.light-theme .nav-ai-assistant {
    background: var(--white-primary);
    border: 1px solid var(--border-dark);
    color: var(--black-primary);
}

.nav-ai-assistant:hover {
    transform: scale(1.1);
    border-color: var(--white-primary);
}

body.light-theme .nav-ai-assistant:hover {
    border-color: var(--black-primary);
}

/* Enhanced Glass Effect for All Interactive Elements */
.header-btn,
.quick-btn,
.setting-btn,
.model-option,
.voice-btn,
.close-panel-btn {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .ai-chat-container {
        width: calc(100vw - 40px);
        right: 20px;
        height: 70vh;
        bottom: 80px;
    }
    
    .ai-assistant {
        bottom: 20px;
        right: 20px;
    }
    
    .history-panel {
        max-height: 300px;
    }
    
    .history-item {
        padding: 10px;
    }
}

@media screen and (max-width: 480px) {
    .ai-chat-container {
        width: calc(100vw - 30px);
        right: 15px;
        height: 75vh;
    }
    
    .quick-btn {
        min-width: 50px;
        padding: 5px 6px;
        font-size: 8px;
    }
    
    .quick-btn i {
        font-size: 10px;
    }
}

/* Emergency Fix - Make AI Chat Hidden by Default */
.ai-chat-container {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(20px) scale(0.95) !important;
}

.ai-chat-container.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

.ai-assistant {
    display: flex !important;
}
/* Enhanced Quick Actions with Horizontal Scroll */
.quick-actions-scrollable {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-medium) transparent;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.quick-actions-scrollable::-webkit-scrollbar {
    height: 4px;
}

.quick-actions-scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.quick-actions-scrollable::-webkit-scrollbar-thumb {
    background: var(--gray-medium);
    border-radius: 10px;
}

.quick-actions-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--gray-light);
}

.quick-btn {
    flex-shrink: 0;
    min-width: 70px;
}

/* Ensure robot icon for Kuku AI everywhere */
.ai-avatar .fa-robot {
    font-size: 14px;
}

.message-avatar .fa-robot {
    font-size: 12px;
}

