/* Unified Chat Interface Styles - ChatGPT Style (Open Layout) */

/* Main Container - No card wrapper */
.unified-chat-open {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Capability Selector Above Input */
.capability-selector-open {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-top: 20px;
    margin-bottom: 15px;
    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
}

.capability-tabs {
    display: flex;
    gap: 8px;
}

.capability-tab-open {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
}

.capability-tab-open:hover {
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.03));
    border-color: var(--color-primary, #667eea);
}

.capability-tab-open--active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

/* Disabled capability tab */
.capability-tab-open--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.capability-tab-open--disabled:hover {
    background: transparent;
    border-color: var(--color-border, rgba(0, 0, 0, 0.1));
    transform: none;
}

/* Coming Soon badge */
.capability-tab__badge {
    font-size: 0.7rem;
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 600;
}

.capability-tab__icon {
    font-size: 1.125rem;
}

.capability-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    opacity: 0.6;
    transition: all 0.2s;
}

.action-btn:hover {
    opacity: 1;
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.05));
}

/* Messages Area - Open, no wrapper */
.chat-messages-open {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
    margin-bottom: 0;
    width: 100%;
}

/* Scrollbar on the right edge */
.chat-messages-open::-webkit-scrollbar {
    width: 8px;
}

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

.chat-messages-open::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chat-messages-open::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Welcome Message - ChatGPT Style */
.welcome-message-open {
    text-align: center;
    max-width: 700px;
    margin: 80px auto;
}

.welcome-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-icon svg {
    stroke: white;
}

.welcome-message-open h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--color-text-primary);
}

.welcome-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
}

.suggestion-chip {
    padding: 12px 20px;
    background: var(--color-bg, white);
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9375rem;
    color: var(--color-text-primary);
}

.suggestion-chip:hover {
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.03));
    border-color: var(--color-primary, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Capability Info */
.capability-info {
    text-align: center;
    max-width: 500px;
    margin: 80px auto;
    padding: 40px;
    background: var(--color-bg, white);
    border-radius: 16px;
    border: 1px solid var(--color-border, #e0e0e0);
}

.capability-info__icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.capability-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text-primary);
}

.capability-info p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
    background: transparent;
    border: none;
    padding: 0;
}

/* AI Messages - Icon on Left */
.chat-message--assistant {
    flex-direction: row;
}

/* User Messages - Icon on Right */
.chat-message--user {
    flex-direction: row-reverse;
}

.chat-message__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message--user .chat-message__avatar {
    background: linear-gradient(135deg, #43E97B 0%, #38F9D7 100%);
}

.chat-message__avatar svg {
    stroke: white;
}

.chat-message__content {
    flex: 1;
    min-width: 0;
    max-width: 70%;
    background: transparent;
    border: none;
    padding: 0;
}

.chat-message__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    background: transparent;
    border: none;
    padding: 0;
}

/* AI Messages - Header aligned left */
.chat-message--assistant .chat-message__header {
    flex-direction: row;
}

/* User Messages - Header aligned right */
.chat-message--user .chat-message__header {
    flex-direction: row-reverse;
}

.chat-message__author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-primary);
}

.chat-message--user .chat-message__author {
    color: var(--color-text-secondary);
}

.chat-message__time {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.chat-message__text {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.6;
    word-wrap: break-word;
    border: none;
}

/* AI Messages - Left aligned bubble */
.chat-message--assistant .chat-message__text {
    background: var(--color-bg, white);
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    color: var(--color-text-primary);
    border-radius: 18px 18px 18px 4px;
}

.chat-message--assistant .chat-message__content {
    background: transparent !important; /* Override components.css */
    border: none !important;
    padding: 0 !important;
}

/* User Messages - Right aligned bubble with different style */
.chat-message--user .chat-message__text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.chat-message--user .chat-message__content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: transparent !important; /* Override components.css blue background */
    border: none !important;
    padding: 0 !important;
}

.chat-message__text--streaming::after {
    content: '▋';
    animation: blink 1s infinite;
}

.chat-message__files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* Typing Indicator */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--color-text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* File Attachment */
.file-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--color-bg, white);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    max-width: 250px;
}

.file-attachment__preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.file-attachment__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-attachment__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-secondary, #f9f9f9);
    border-radius: 6px;
    flex-shrink: 0;
}

.file-attachment__icon svg {
    stroke: var(--color-text-secondary);
}

.file-attachment__info {
    flex: 1;
    min-width: 0;
}

.file-attachment__name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-attachment__size {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.file-attachment__remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.file-attachment__remove:hover {
    opacity: 1;
    background: rgba(255, 0, 0, 0.1);
}

.file-attachment__remove svg {
    stroke: #ff4444;
}

/* Capability Selector */
.capability-selector {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    background: var(--color-bg, white);
    overflow-x: auto;
}

.capability-selector::-webkit-scrollbar {
    height: 4px;
}

.capability-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.capability-tab:hover {
    background: var(--color-bg-secondary, #f9f9f9);
    border-color: var(--color-primary, #667eea);
}

.capability-tab--active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.capability-tab__icon {
    font-size: 1.125rem;
}

/* Input Area - Floating input like ChatGPT */
.chat-input-wrapper {
    position: sticky;
    bottom: 0;
    background: transparent;
    padding: 20px 0;
}

.unified-input-container {
    background: transparent;
}

.unified-input-area {
    padding: 0;
    background: transparent;
}

.unified-input-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.unified-input-controls {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--color-bg, white);
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    border-radius: 24px;
    padding: 8px 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.unified-input-controls:focus-within {
    border-color: var(--color-primary, #667eea);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.input-control-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0.6;
}

.input-control-btn:hover {
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.05));
    opacity: 1;
}

.input-control-btn:hover svg {
    stroke: var(--color-primary, #667eea);
}

.input-control-btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 1;
}

.input-control-btn--primary svg {
    stroke: white;
}

.input-control-btn--primary:hover {
    opacity: 0.9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.unified-input-textarea {
    flex: 1;
    min-height: 20px;
    max-height: 200px;
    padding: 8px 4px;
    border: none;
    border-radius: 0;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    background: transparent;
    color: var(--color-text-primary);
    outline: none;
}

.unified-input-textarea::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.6;
}

.unified-input-textarea::placeholder {
    color: var(--color-text-secondary);
}

/* Error Message */
.error-message {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #fff3f3;
    border: 1px solid #ffcccc;
    border-radius: 12px;
    margin: 10px 0;
}

.error-message__icon {
    flex-shrink: 0;
}

.error-message__icon svg {
    stroke: #ff4444;
}

.error-message__content {
    flex: 1;
}

.error-message__content strong {
    display: block;
    color: #cc0000;
    margin-bottom: 4px;
}

.error-message__content p {
    color: #880000;
    margin: 0;
    font-size: 0.875rem;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-bg, white);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 12px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-bg-secondary, #f9f9f9);
    border-top-color: var(--color-primary, #667eea);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-message {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .unified-chat-open {
        padding: 0 15px;
    }

    .capability-selector-open {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .capability-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .chat-messages-open {
        padding: 15px 0;
        max-height: 500px;
    }

    .welcome-message-open {
        margin: 40px auto;
    }

    .welcome-message-open h3 {
        font-size: 1.5rem;
    }

    .suggestion-chip {
        font-size: 0.875rem;
        padding: 10px 16px;
    }

    .chat-input-wrapper {
        padding: 15px 0;
    }

    .chat-message__avatar {
        width: 32px;
        height: 32px;
    }

    .chat-message__avatar svg {
        width: 18px;
        height: 18px;
    }
}

/* Dark Theme Support */
html[data-theme="dark"] .capability-selector-open {
    border-top-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .capability-tab-open {
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .capability-tab-open:hover {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .capability-tab__badge {
    background: rgba(255, 193, 7, 0.3);
    color: #ffd54f;
}

html[data-theme="dark"] .unified-input-controls {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .unified-input-controls:focus-within {
    border-color: var(--color-primary, #667eea);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
}

html[data-theme="dark"] .chat-message--assistant .chat-message__text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* User messages keep their gradient in dark mode - no border */
html[data-theme="dark"] .chat-message--user .chat-message__text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

html[data-theme="dark"] .suggestion-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .suggestion-chip:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .unified-input-textarea {
    color: var(--color-text-primary);
}

html[data-theme="dark"] .input-control-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .file-attachment {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Markdown Styling - Only for Assistant Messages */
.chat-message--assistant .chat-message__text h1,
.chat-message--assistant .chat-message__text h2,
.chat-message--assistant .chat-message__text h3 {
    margin: 16px 0 12px 0;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text-primary);
}

.chat-message--assistant .chat-message__text h1 {
    font-size: 1.5rem;
}

.chat-message--assistant .chat-message__text h2 {
    font-size: 1.25rem;
}

.chat-message--assistant .chat-message__text h3 {
    font-size: 1.1rem;
}

.chat-message--assistant .chat-message__text p {
    margin: 8px 0;
    line-height: 1.6;
}

.chat-message--assistant .chat-message__text code {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
}

.chat-message--assistant .chat-message__text pre {
    background: var(--color-bg-secondary, #f5f5f5);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    overflow-x: auto;
}

.chat-message--assistant .chat-message__text pre code {
    background: transparent;
    color: var(--color-text-primary);
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.chat-message--assistant .chat-message__text ul,
.chat-message--assistant .chat-message__text ol {
    margin: 12px 0;
    padding-left: 24px;
}

.chat-message--assistant .chat-message__text li {
    margin: 6px 0;
    line-height: 1.6;
}

.chat-message--assistant .chat-message__text a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    transition: all 0.2s;
}

.chat-message--assistant .chat-message__text a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

.chat-message--assistant .chat-message__text strong {
    font-weight: 600;
    color: var(--color-text-primary);
}

.chat-message--assistant .chat-message__text em {
    font-style: italic;
}

/* Dark theme markdown styles */
html[data-theme="dark"] .chat-message--assistant .chat-message__text code {
    background: rgba(102, 126, 234, 0.2);
    color: #a5b4fc;
}

html[data-theme="dark"] .chat-message--assistant .chat-message__text pre {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .chat-message--assistant .chat-message__text a {
    color: #a5b4fc;
}

html[data-theme="dark"] .chat-message--assistant .chat-message__text a:hover {
    color: #c4b5fd;
}

/* Speech Translation Modal */
.speech-translation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.speech-translation-modal.closing {
    animation: fadeOut 0.3s ease;
}

.speech-translation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.speech-translation-content {
    position: relative;
    background: var(--color-bg, white);
    border-radius: 24px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.speech-translation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
}

.speech-translation-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.speech-translation-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    opacity: 0.6;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speech-translation-close:hover {
    opacity: 1;
    background: rgba(255, 0, 0, 0.1);
}

.speech-translation-close svg {
    stroke: #ff4444;
}

.speech-translation-description {
    padding: 16px 32px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.03));
}

.speech-translation-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    padding: 0 32px;
    gap: 8px;
}

.speech-tab-button {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.speech-tab-button:hover {
    color: var(--color-text-primary);
}

.speech-tab-button.speech-tab-active {
    color: var(--color-accent-primary, #667eea);
    border-bottom-color: var(--color-accent-primary, #667eea);
    font-weight: 600;
}

.speech-translation-body {
    padding: 32px;
}

.speech-input-panel {
    margin-bottom: 24px;
}

/* Voice Input Panel */
.speech-mic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 0;
}

.push-to-talk-btn {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
    user-select: none;
    -webkit-user-select: none;
}

.push-to-talk-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.push-to-talk-btn:active,
.push-to-talk-btn.recording {
    transform: scale(0.95);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    animation: pulse 1s infinite;
}

.push-to-talk-btn svg {
    stroke: white;
}

.recording-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 20px;
    color: #ff6b6b;
    font-size: 0.875rem;
    font-weight: 600;
}

.recording-dot {
    width: 8px;
    height: 8px;
    background: #ff6b6b;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.speech-hint {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Text Input Panel */
.text-to-translate {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    background: var(--color-bg, white);
    color: var(--color-text-primary);
    transition: all 0.2s;
}

.text-to-translate:focus {
    outline: none;
    border-color: var(--color-accent-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-input-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.text-input-actions .btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.text-input-actions .btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.text-input-actions .btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.text-input-actions .btn--secondary {
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.05));
    color: var(--color-text-primary);
}

.text-input-actions .btn--secondary:hover {
    background: var(--color-bg-tertiary, rgba(0, 0, 0, 0.08));
}

/* Translation Output */
.speech-output-area {
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.03));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    min-height: 120px;
}

.speech-output-message {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--color-bg, white);
    border-radius: 8px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
}

.speech-output-message:last-child {
    margin-bottom: 0;
}

.speech-output-message strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.transcript-text,
.translation-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-primary);
}

.speech-output-success {
    border-left: 4px solid #43e97b;
}

.speech-output-error {
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
}

.speech-output-error strong {
    color: #ff6b6b;
}

.speech-output-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
}

.speech-output-translating {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
}

.speech-output-translating strong {
    color: #667eea;
}

/* Language Selection */
.speech-language-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.language-select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.language-select-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.language-select {
    padding: 10px 16px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    background: var(--color-bg, white);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.language-select:focus {
    outline: none;
    border-color: var(--color-accent-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Speech Actions Footer */
.speech-actions-footer {
    display: flex;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
}

.btn--ghost {
    background: none;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    color: var(--color-text-secondary);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn--ghost:hover {
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.03));
    border-color: var(--color-text-secondary);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

/* Responsive Design for Speech Translation Modal */
@media (max-width: 768px) {
    .speech-translation-content {
        width: 95%;
        max-height: 95vh;
    }

    .speech-translation-header {
        padding: 20px 24px;
    }

    .speech-translation-header h3 {
        font-size: 1.25rem;
    }

    .speech-translation-description {
        padding: 12px 24px;
        font-size: 0.875rem;
    }

    .speech-translation-tabs {
        padding: 0 24px;
    }

    .speech-translation-body {
        padding: 24px;
    }

    .push-to-talk-btn {
        width: 120px;
        height: 120px;
    }

    .speech-language-selection {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .text-input-actions {
        flex-direction: column;
    }

    .text-input-actions .btn {
        width: 100%;
    }
}

/* Dark Theme Support for Speech Translation Modal */
html[data-theme="dark"] .speech-translation-content {
    background: var(--color-bg, #1a1a1a);
}

html[data-theme="dark"] .speech-translation-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .speech-translation-description {
    background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .speech-translation-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .text-to-translate {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

html[data-theme="dark"] .text-to-translate:focus {
    border-color: var(--color-accent-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

html[data-theme="dark"] .speech-output-area {
    background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .speech-output-message {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .language-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

html[data-theme="dark"] .language-select:focus {
    border-color: var(--color-accent-primary, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

html[data-theme="dark"] .btn--ghost {
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .text-input-actions .btn--secondary {
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .text-input-actions .btn--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .speech-actions-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Inline Translation Interface */
.translation-interface-inline {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    min-height: 600px;
}

/* Controls Section (Button + Language Selectors) */
.translation-controls-fixed {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    margin: 0 -20px -20px -20px;
    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    background: var(--color-bg, white);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.push-to-talk-btn-inline {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
    user-select: none;
    -webkit-user-select: none;
}

.push-to-talk-btn-inline:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.push-to-talk-btn-inline:active,
.push-to-talk-btn-inline.recording {
    transform: scale(0.95);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    animation: pulse 1s infinite;
}

.push-to-talk-btn-inline svg {
    stroke: white;
}

.recording-indicator-inline {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 20px;
    color: #ff6b6b;
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    top: 8px;
}

/* Compact Language Selection */
.translation-language-selection-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 500px;
}

.language-select-compact {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.15));
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8125rem;
    background: var(--color-bg, white);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.language-select-compact:focus {
    outline: none;
    border-color: var(--color-accent-primary, #667eea);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.arrow-icon {
    flex-shrink: 0;
    opacity: 0.5;
}

.translation-history-inline {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--color-bg-secondary, rgba(0, 0, 0, 0.03));
    border-radius: 12px;
    margin-bottom: 16px;
    min-height: 300px;
}

.translation-history-inline::-webkit-scrollbar {
    width: 8px;
}

.translation-history-inline::-webkit-scrollbar-track {
    background: transparent;
}

.translation-history-inline::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.translation-history-inline::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.translation-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-secondary);
    height: 100%;
}

.translation-placeholder p {
    margin: 0;
    font-size: 1rem;
}

.translation-placeholder p:first-of-type {
    font-weight: 500;
}

.translation-item {
    background: var(--color-bg, white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    animation: fadeInUp 0.3s ease;
}

.translation-item:last-child {
    margin-bottom: 0;
}

.translation-original,
.translation-result {
    margin-bottom: 16px;
}

.translation-result:last-child {
    margin-bottom: 0;
}

.translation-original strong,
.translation-result strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.translation-text {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-text-primary);
}

.translation-result.success {
    border-left: 4px solid #43e97b;
    padding-left: 16px;
}

.translation-result.error {
    background: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
    padding-left: 16px;
}

.translation-result.error strong {
    color: #ff6b6b;
}

.translation-result.translating {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    padding-left: 16px;
}

.translation-result.translating strong {
    color: #667eea;
}

/* Responsive Design for Inline Translation */
@media (max-width: 768px) {
    .translation-interface-inline {
        padding: 15px;
        height: calc(100vh - 250px);
        min-height: 500px;
    }

    .translation-controls-fixed {
        padding: 10px 15px;
    }

    .push-to-talk-btn-inline {
        width: 60px;
        height: 60px;
        font-size: 0.625rem;
    }

    .push-to-talk-btn-inline svg {
        width: 20px;
        height: 20px;
    }

    .translation-language-selection-compact {
        flex-direction: column;
        gap: 8px;
    }

    .arrow-icon {
        transform: rotate(90deg);
    }

    .translation-history-inline {
        margin-bottom: 12px;
        padding: 16px;
    }

    .translation-item {
        padding: 16px;
    }

    .translation-text {
        font-size: 1rem;
    }

    .translation-placeholder {
        padding: 40px 15px;
    }
}

/* Dark Theme Support for Inline Translation */
html[data-theme="dark"] .translation-controls-fixed {
    border-top-color: rgba(255, 255, 255, 0.1);
    background: var(--color-bg, #1a1a1a);
}

html[data-theme="dark"] .language-select-compact {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--color-text-primary, white);
}

html[data-theme="dark"] .language-select-compact option {
    background: #2a2a2a;
    color: white;
}

html[data-theme="dark"] .language-select-compact:focus {
    border-color: var(--color-accent-primary, #667eea);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

html[data-theme="dark"] .arrow-icon {
    stroke: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

html[data-theme="dark"] .translation-history-inline {
    background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .translation-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .translation-history-inline::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .translation-history-inline::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
