:root {
    --bg-color: #1a1a1a;
    --button-bg: #2d2d2d;
    --button-hover: #3d3d3d;
    --text-color: #ffffff;
    --accent-color: #4CAF50;
    --danger-color: #ff4444;
    --ai-color: #6d48e5;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Video Call Container */
.video-call-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* AI Video Display */
.ai-video {
    position: relative;
    width: 100%;
    height: calc(100% - 180px);
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.ai-avatar {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--ai-color) 0%, rgba(28, 28, 45, 0.8) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(109, 72, 229, 0.4);
    position: relative;
    transition: transform 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.ai-avatar:hover {
    transform: scale(1.05);
}

.ai-avatar::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 20%);
    z-index: 1;
    pointer-events: none;
}

.ai-avatar.speaking {
    animation: avatar-speaking 2s infinite ease-in-out;
}

@keyframes avatar-speaking {
    0% { transform: scale(1); box-shadow: 0 0 30px rgba(109, 72, 229, 0.6); }
    30% { transform: scale(1.03) translateY(-3px); box-shadow: 0 0 40px rgba(109, 72, 229, 0.7); }
    60% { transform: scale(1.05) translateY(2px); box-shadow: 0 0 45px rgba(109, 72, 229, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 30px rgba(109, 72, 229, 0.6); }
}

.ai-face {
    width: 220px;
    height: 220px;
    position: relative;
    z-index: 2;
}

.ai-eyes {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    height: 20px;
    display: flex;
    justify-content: space-evenly;
}

.ai-eyes:before, .ai-eyes:after {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: eye-movement 8s infinite ease-in-out;
}

.ai-eyes:before {
    animation-delay: 0.5s;
}

@keyframes eye-movement {
    0%, 10%, 90%, 100% { transform: translateX(0) scaleY(1); }
    15% { transform: translateX(-3px) scaleY(1); }
    20% { transform: translateX(3px) scaleY(1); }
    22%, 24% { transform: translateX(0) scaleY(0.1); } /* Blink */
    25% { transform: translateX(0) scaleY(1); }
    40% { transform: translateX(4px) scaleY(1); }
    50% { transform: translateX(-4px) scaleY(1); }
    60% { transform: translateX(0) scaleY(1); }
    75%, 77% { transform: translateX(0) scaleY(0.1); } /* Second blink */
    78% { transform: translateX(0) scaleY(1); }
}

.ai-mouth {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 10px;
    background-color: white;
    border-radius: 30px;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.ai-mouth.speaking {
    animation: speak-complex 0.6s infinite ease-in-out;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

@keyframes speak-complex {
    0% { height: 5px; width: 40px; border-radius: 30px; }
    20% { height: 15px; width: 30px; border-radius: 10px; }
    40% { height: 8px; width: 50px; border-radius: 15px; }
    60% { height: 20px; width: 40px; border-radius: 10px; }
    80% { height: 10px; width: 45px; border-radius: 20px; }
    100% { height: 5px; width: 40px; border-radius: 30px; }
}

.ai-name {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 20px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 500;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #f0f0f0, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glow 3s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 5px rgba(255, 255, 255, 0.3); }
    50% { text-shadow: 0 0 15px rgba(255, 255, 255, 0.5); }
}

/* User Camera Preview */
.camera-preview {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 180px;
    height: 135px;
    background-color: var(--button-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Screen Preview */
.screen-preview {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 180px;
    height: 101px; /* 16:9 aspect ratio */
    background-color: var(--button-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10;
    display: none; /* Hidden by default */
    box-shadow: 0 4px 10px var(--shadow-color);
}

.screen-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Chat Container */
.chat-container {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 300px;
    max-height: 50vh;
    background: rgba(45, 45, 45, 0.9);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 20;
}

.chat-header {
    background: var(--button-bg);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 12px;
}

.chat-history {
    max-height: calc(50vh - 40px);
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-container.collapsed .chat-history {
    display: none;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.user-message {
    background: #2c5282;
    color: white;
    align-self: flex-end;
}

.model-message {
    background: #2d3748;
    color: white;
    align-self: flex-start;
}

.model-message.streaming::after {
    content: '▋';
    display: inline-block;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

/* Control Panel */
.control-panel {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    z-index: 30;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--button-bg);
    border: 2px solid var(--accent-color);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    font-size: 24px;
}

.control-btn:hover {
    background-color: var(--button-hover);
    transform: scale(1.05);
}

.control-btn.active {
    background-color: var(--accent-color);
}

.disconnect-btn {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.disconnect-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

.connect-btn {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.connect-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Text Input Container */
.text-input-container {
    position: fixed;
    bottom: 100px;
    left: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 30;
}

.text-input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 30px;
    border: 1px solid var(--accent-color);
    background-color: rgba(45, 45, 45, 0.7);
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.text-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.send-btn:hover {
    background-color: #3d8b40;
    transform: scale(1.05);
}

/* Visualizer */
.visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 5;
    opacity: 0.6;
    pointer-events: none;
}

/* Camera Switch Button */
.camera-switch-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 1000;
    transition: background-color 0.2s;
}

.camera-switch-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Enhanced Settings Dialog Styles */
.settings-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    background: linear-gradient(to bottom, #252525, #1a1a1a);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

.settings-dialog::-webkit-scrollbar {
    width: 8px;
}

.settings-dialog::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 10px;
}

.settings-dialog::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
}

.settings-group {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-group:last-child {
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.settings-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ccc;
    font-weight: 500;
}

.settings-group input[type="text"],
.settings-group input[type="password"],
.settings-group input[type="number"],
.settings-group select,
.settings-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(45, 45, 45, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.2s ease;
}

.settings-group input:focus,
.settings-group select:focus,
.settings-group textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    outline: none;
}

/* Collapsible Sections */
.collapsible {
    background-color: rgba(55, 55, 55, 0.5);
    color: white;
    cursor: pointer;
    padding: 14px 18px;
    width: 100%;
    text-align: left;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.collapsible:hover {
    background-color: rgba(65, 65, 65, 0.7);
}

.collapsible:after {
    content: '▼';
    position: absolute;
    right: 15px;
    color: var(--accent-color);
    transition: transform 0.3s ease;
}

.collapsible.active:after {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(35, 35, 35, 0.5);
    border-radius: 0 0 8px 8px;
    margin-top: -10px;
    padding: 0 15px;
}

.collapsible-content.active {
    max-height: 500px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Range Inputs with Labels */
.range-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.range-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.range-header label {
    margin-bottom: 0;
}

.range-value {
    font-weight: 500;
    color: var(--accent-color);
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Save Button */
.settings-save-btn {
    background: linear-gradient(to right, var(--accent-color), #66bb6a);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 26px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.settings-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

.settings-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

/* Toggle Switch Enhancements */
.toggle-switch-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.toggle-switch-container label:first-child {
    flex: 1;
    margin-bottom: 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    margin-left: 15px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(80, 80, 80, 0.5);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.settings-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    line-height: 1.4;
}

/* Custom system instructions styling */
#customInstructionsGroup {
    background-color: rgba(109, 72, 229, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border-left: 3px solid var(--ai-color);
}

#systemInstructions {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Media queries */
@media (max-width: 768px) {
    .app-container {
        height: 100vh;
        overflow: hidden;
    }
    
    .ai-avatar {
        width: 200px;
        height: 200px;
    }
    
    .ai-face {
        width: 160px;
        height: 160px;
    }
    
    .control-panel {
        bottom: 10px;
        padding: 10px;
        gap: 10px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .prompt-selector-container {
        top: 10px;
        right: 10px;
        width: 250px;
    }
    
    .chat-container {
        top: 10px;
        right: 10px;
        width: 250px;
        max-height: 40vh;
    }
    
    .camera-preview {
        bottom: 70px;
        right: 10px;
        width: 120px;
        height: 90px;
    }
    
    .text-input-container {
        bottom: 75px;
        width: calc(100% - 150px);
    }
}

@media (max-width: 480px) {
    .ai-avatar {
        width: 180px;
        height: 180px;
    }
    
    .ai-face {
        width: 140px;
        height: 140px;
    }
    
    .prompt-selector-container, .chat-container {
        width: 200px;
    }
    
    .text-input-container {
        width: calc(100% - 130px);
    }
    
    .chat-message {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

/* Prompt Selector */
.prompt-selector-container {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 300px;
    background: rgba(45, 45, 45, 0.9);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    z-index: 20;
}

.prompt-header {
    background: var(--button-bg);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prompt-header-buttons {
    display: flex;
    gap: 10px;
}

.custom-instruction-btn {
    background: rgba(109, 72, 229, 0.3);
    border: 1px solid var(--ai-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s;
}

.custom-instruction-btn:hover {
    background: rgba(109, 72, 229, 0.6);
    transform: scale(1.1);
}

.create-prompt-btn {
    background: var(--accent-color);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prompts-list {
    padding: 15px;
}

.prompt-select {
    width: 100%;
    padding: 10px;
    background-color: var(--button-bg);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 14px;
    outline: none;
}

.use-prompt-btn {
    width: 100%;
    padding: 10px;
    margin: 0 15px 15px 15px;
    width: calc(100% - 30px);
    background-color: var(--accent-color);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.use-prompt-btn:hover {
    background-color: #3d8b40;
}

/* Prompt Editor Dialog */
.prompt-editor-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    z-index: 1001;
}

.prompt-editor-dialog.active {
    display: block;
}

.prompt-editor-title {
    font-size: 18px;
    margin-bottom: 15px;
}

.prompt-form-group {
    margin-bottom: 15px;
}

.prompt-form-group label {
    display: block;
    margin-bottom: 5px;
}

.prompt-form-group input,
.prompt-form-group textarea {
    width: 100%;
    padding: 10px;
    background-color: var(--button-bg);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
}

.prompt-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.prompt-editor-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.prompt-editor-cancel,
.prompt-editor-save {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.prompt-editor-cancel {
    background-color: var(--button-bg);
    border: 1px solid #666;
    color: var(--text-color);
}

.prompt-editor-save {
    background-color: var(--accent-color);
    border: none;
    color: white;
}

/* Custom Instruction Dialog */
.custom-instruction-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-color);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    z-index: 1001;
}

.custom-instruction-dialog.active {
    display: block;
}

.custom-instruction-title {
    font-size: 18px;
    margin-bottom: 15px;
}

.custom-instruction-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background-color: var(--button-bg);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 20px;
    line-height: 1.5;
}

.custom-instruction-actions {
    display: flex;
    gap: 15px;
}

.custom-instruction-hint {
    margin-top: 15px;
    margin-bottom: 20px;
    color: #aaa;
    font-size: 13px;
    background-color: rgba(109, 72, 229, 0.1);
    border-left: 3px solid var(--ai-color);
    padding: 10px;
    border-radius: 0 4px 4px 0;
}

.custom-instruction-hint strong {
    color: #ccc;
}

.custom-instruction-hint ul {
    margin-top: 5px;
    padding-left: 20px;
}

.custom-instruction-hint li {
    margin-bottom: 5px;
}

.custom-instruction-save-as {
    margin-top: 15px;
    padding: 10px;
    background-color: var(--button-bg);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
}

.custom-instruction-save-as input {
    padding: 8px;
    width: 100%;
    background-color: var(--button-bg);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    color: var(--text-color);
    margin-bottom: 10px;
}

/* Add these critical display properties back to make settings clickable */
.settings-dialog.active {
    display: block;
}

.settings-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.settings-overlay.active {
    display: block;
}

/* Floating animation */
@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(1deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(5px) rotate(-1deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Add a pulsating aura effect around the avatar */
.ai-avatar::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(109, 72, 229, 0.6);
    z-index: 0;
    animation: aura-pulse 4s infinite ease-in-out;
}

@keyframes aura-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.2;
    }
    50% { 
        transform: scale(1.1); 
        opacity: 0.5;
    }
}

/* Add thinking animation */
.ai-avatar.thinking {
    animation: thinking 3s infinite ease-in-out;
}

@keyframes thinking {
    0% { transform: scale(1); }
    25% { transform: scale(0.98); }
    50% { transform: scale(1.02); }
    75% { transform: scale(0.99); }
    100% { transform: scale(1); }
}

/* Listening state animation */
.ai-avatar.listening .ai-mouth {
    animation: listening 2s infinite ease-in-out;
    width: 30px;
    height: 3px;
}

@keyframes listening {
    0%, 100% { transform: translateX(-50%) scaleX(1); }
    50% { transform: translateX(-50%) scaleX(1.5); }
}

/* Add a subtle smile on hover */
.ai-avatar:hover .ai-mouth {
    height: 10px;
    width: 50px;
    border-radius: 0 0 25px 25px;
    transform: translateX(-50%);
}
