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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    overflow-x: hidden;
    padding: 1rem;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
    }
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 650px;
    height: auto;
    max-height: 1162px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .container {
        height: auto;
        max-height: 1162px;
        border-radius: 15px;
        margin: 0;
    }
}

.chat-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1rem;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .chat-header {
        padding: 1rem;
        border-radius: 15px 15px 0 0;
    }
}

.header-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .header-main {
        gap: 0.75rem;
    }
}

.session-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.session-details .session-info {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.4;
}

.session-details code {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.header-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.header-info p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.intent-indicator {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.intent-label {
    opacity: 0.8;
}

.intent-detecting {
    color: #ffc107;
    font-weight: 500;
}

.intent-detected {
    color: #28a745;
    font-weight: 600;
}

.intent-offline {
    color: #da8516;
    font-weight: 400;
}

.status-indicator {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse 2s infinite;
}

.status-dot.connecting {
    background: #fbbf24;
}

.status-dot.error {
    background: #ef4444;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
    min-height: 0;
}

/* Custom scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile scrollbar improvements */
@media (max-width: 768px) {
    .chat-messages::-webkit-scrollbar {
        width: 8px;
    }
    
    .chat-messages::-webkit-scrollbar-thumb {
        background: #999;
    }
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 80%;
    animation: slideIn 0.3s ease-out;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message.agent .message-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.agent .message-bubble {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.thinking .message-bubble {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-style: italic;
    animation: thinkingPulse 2s infinite ease-in-out;
}

.message.thinking .message-avatar {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    animation: thinkingBounce 1.5s infinite ease-in-out;
}

@keyframes thinkingPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

@keyframes thinkingBounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-2px); }
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 0.25rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 80px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

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

.chat-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.voice-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voice-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.voice-btn.disconnect {
    background: #ffffff;
    color: white;
    border: 1px solid #d61515;
}

.voice-btn.disconnect:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    border: 1px solid #d61515;
}


.voice-visualizer {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 0.5rem;
}

.voice-bar {
    width: 3px;
    background: #667eea;
    border-radius: 2px;
    animation: voiceWave 1s infinite ease-in-out;
}

.voice-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.voice-bar:nth-child(2) { height: 12px; animation-delay: 0.1s; }
.voice-bar:nth-child(3) { height: 16px; animation-delay: 0.2s; }
.voice-bar:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.voice-bar:nth-child(5) { height: 8px; animation-delay: 0.4s; }

@keyframes voiceWave {
    0%, 100% { transform: scaleY(0.3); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

.connection-status {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
}

.connection-status.connected {
    color: #10b981;
}

.connection-status.connecting {
    color: #f59e0b;
}

.connection-status.error {
    color: #ef4444;
}

.connection-form {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    min-height: 0;
}

@media (max-width: 768px) {
    .connection-form {
        padding: 0.75rem 0.75rem 0.25rem 0.75rem;
        justify-content: flex-start;
        align-items: flex-start;
        padding-top: 1.5rem;
    }
}

.form-container {
    width: 100%;
    max-width: 700px;
    text-align: center;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .form-container {
        max-width: 100%;
        margin-bottom: 0.25rem;
    }
}

.form-container h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .form-container h2 {
        font-size: 1.5rem;
    }
}

.form-container p {
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.intent-selection {
    margin-bottom: 2rem;
    text-align: center;
}

.intent-selection h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.intent-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.intent-btn {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    position: relative;
    overflow: hidden;
}

.intent-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #fff, #f8f9fa);
}

.intent-btn.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.intent-btn.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.intent-help {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.form-group-label {
    flex-shrink: 0;
    font-weight: 600;
    color: #2c3e50;
    min-width: 120px;
    padding-top: 1rem; /* Align with input padding */
}

.form-group-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

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

.form-group select {
    background: white;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

@media (max-width: 768px) {
    .form-group {
        gap: 0.5rem;
    }
    
    .form-group-label {
        min-width: 100px;
        font-size: 0.9rem;
        padding-top: 1rem; /* Align with mobile input padding */
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.voice-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Voice preview UI */
.voice-select-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.voice-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.voice-preview-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-preview-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.voice-preview-btn:not(:disabled):hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

/* Custom voice dropdown (single dropdown with per-row preview button) */
.voice-dropdown {
    position: relative;
    flex: 1;
    min-width: 0;
}

.voice-dropdown-toggle {
    width: 100%;
    height: 44px;
    padding: 0 2.5rem 0 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-size: 1.05rem;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.6rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    transition: all 0.2s ease;
}

.voice-dropdown-toggle:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.voice-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    z-index: 50;
}

.voice-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f3f5;
}

.voice-dropdown-item:last-child {
    border-bottom: none;
}

.voice-dropdown-item.selected {
    background: rgba(102, 126, 234, 0.08);
}

.voice-dropdown-name {
    flex: 1;
    min-width: 0;
    font-size: 0.98rem;
    color: #2c3e50;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-dropdown-play {
    width: 36px;
    height: 32px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.voice-dropdown-play:hover {
    border-color: #667eea;
}

.voice-dropdown-play:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle Switch Styles */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: auto;
    justify-content: flex-start;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    width: auto;
    justify-content: flex-start;
}

.toggle-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.3s ease;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    transition: background 0.3s ease;
    border: 2px solid transparent;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-label .toggle-slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-label .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-label .toggle-text:first-child {
    color: #667eea;
    font-weight: 600;
}

.toggle-switch input[type="checkbox"]:not(:checked) + .toggle-label .toggle-text:last-child {
    color: #667eea;
    font-weight: 600;
}

.toggle-switch input[type="checkbox"]:not(:checked) + .toggle-label .toggle-text:first-child {
    color: #6b7280;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-label .toggle-text:last-child {
    color: #6b7280;
}

/* Hover effects */
.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.toggle-switch input[type="checkbox"]:focus + .toggle-label .toggle-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Ensure toggle switch aligns with form inputs */
.form-group .toggle-switch {
    margin-top: 0;
    padding-top: 0;
}

/* Specific alignment for toggle switch in form groups */
.form-group-toggle .toggle-switch {
    margin-top: 0.5rem; /* Match the label padding */
    align-self: center; /* Center the toggle switch horizontally */
}

/* Align toggle switch with other form elements */
.form-group-content .toggle-switch {
    align-self: center; /* Center the toggle switch horizontally */
}

/* Fix vertical alignment for FAQ Response Mode label with toggle switch */
.form-group-toggle .form-group-label {
    padding-top: 0.5rem; /* Reduce padding to align with toggle switch */
    display: flex;
    align-items: center;
}

.btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn.danger:hover {
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.btn.muted {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.status {
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Toast notification styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 300px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    min-width: 200px;
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-size: 14px;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #dc2626;
}

.toast.success {
    background: #f0fdf4;
    border-left-color: #10b981;
    color: #059669;
}

.toast.warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #d97706;
}

.toast.info {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #2563eb;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 14px;
}

.toast-message {
    font-size: 13px;
    line-height: 1.3;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #6b7280;
}

@media (max-width: 768px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: auto;
        max-width: calc(100vw - 20px);
    }

    .toast {
        min-width: 150px;
        max-width: calc(100vw - 20px);
        padding: 8px 12px;
        font-size: 12px;
    }

    .toast-icon {
        font-size: 12px;
    }

    .toast-title {
        font-size: 12px;
    }

    .toast-message {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #toast-container {
        top: 5px;
        right: 5px;
        left: auto;
        max-width: calc(100vw - 10px);
    }

    .toast {
        min-width: 120px;
        max-width: calc(100vw - 10px);
        padding: 6px 10px;
        font-size: 11px;
    }

    .toast-icon {
        font-size: 11px;
    }

    .toast-title {
        font-size: 11px;
    }

    .toast-message {
        font-size: 10px;
    }
}

.toast.intent-change {
    background-color: #4a6da7;
    color: white;
}

.toast.intent-change .toast-title,
.toast.intent-change .toast-message {
    color: white;
}

.toast.intent-change .toast-close {
    color: rgba(255, 255, 255, 0.8);
}

.toast.intent-change .toast-close:hover {
    color: white;
}

.toast-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.log-divider {
    margin: 1.5rem 0;
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    width: 100%;
}

.updated {
    background-color: #16a085;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.status.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.status.connected {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border: 1px solid #86efac;
    color: #166534;
}

.status.connecting {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fcd34d;
    color: #92400e;
    animation: pulse 2s infinite;
}

.status.warning {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    border: 1px solid #fb923c;
    color: #9a3412;
}

.status.error {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    border: 1px solid #f87171;
    color: #991b1b;
}

.retry-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.session-info {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.controls {
    display: none;
    margin-top: 1.5rem;
    gap: 1rem;
    order: 2; /* Place it before the conversation log but after the form */
}

.controls.show {
    display: flex;
}

/* Removed complex analytics CSS - using simple intent indicator in header instead */

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.features-list {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Live transcript styling */
.transcript-container {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    display: none;
    order: 2.5; /* Position between controls and conversation log */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.transcript-container.show {
    display: block !important; /* Use !important to ensure visibility */
}

.transcript-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#transcript-status {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

#transcript-status.listening {
    animation: pulse 1.5s infinite;
}

.transcript-body {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
    padding: 1rem;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.transcript-text {
    margin-bottom: 0.5rem;
}

.transcript-text.final {
    font-weight: 500;
    color: #212529;
}

.transcript-text.interim {
    font-style: italic;
    color: #6c757d;
}

.features-list h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.features-list ul {
    list-style: none;
    color: #495057;
}

.features-list li {
    padding: 0.2rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.features-list li::before {
    content: '✨';
    position: absolute;
    left: 0;
}

@media (max-width: 768px) {
    .container {
        margin: 1rem;
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .intent-buttons {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .conversation-log {
        max-height: 250px;
    }
}
