/* User Info Styles - Fixed for white header background */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    color: #374151;
    font-size: 0.85rem;
}

.user-email {
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #374151;
    font-weight: 500;
}

.user-menu {
    display: flex;
    gap: 0.5rem;
}

.user-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--color-bg-light), #E6E9EC);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-flat-sm);
    text-decoration: none;
    transition: var(--transition-base);
    border: none;
}

.user-menu a:hover {
    box-shadow: var(--shadow-hover-sm);
    transform: translateY(-1px);
}

.user-menu a:active {
    box-shadow: var(--shadow-pressed-sm);
    transform: translateY(0);
}

/* Square button style for audio controls */
.btn-square {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Audio Play/Pause button - same size as other controls */
#audio-play-pause {
    width: 44px;
    height: 44px;
    background: var(--color-primary-gradient);
    border-radius: var(--radius-full);
    color: white;
    box-shadow: var(--shadow-flat-sm);
    border: none;
}

#audio-play-pause:hover {
    box-shadow: var(--shadow-hover-sm);
    transform: scale(1.05);
}

#audio-play-pause:active {
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.15),
                inset -4px -4px 8px rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}

/* Audio Stop button - gray gradient like reference */
#audio-stop {
    background: linear-gradient(145deg, #7A8A9A, #6C7A89);
    color: white;
}

#audio-stop:hover {
    box-shadow: var(--shadow-hover-sm);
    transform: translateY(-1px);
}

#audio-stop:active {
    box-shadow: var(--shadow-pressed-sm);
    transform: translateY(0);
}

/* Play Selected Button Styles - matches play button design */
#audio-play-selected {
    width: 44px;
    height: 44px;
    background: var(--color-primary-gradient);
    border-radius: var(--radius-full);
    color: white;
    box-shadow: var(--shadow-flat-sm);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    position: relative;
}

#audio-play-selected i {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1;
}

#audio-play-selected .btn-label {
    font-size: 0.5rem;
    line-height: 1;
    margin-top: 2px;
    text-transform: lowercase;
    font-weight: 500;
    opacity: 0.9;
}

#audio-play-selected:hover:not(:disabled) {
    box-shadow: var(--shadow-hover-sm);
    transform: scale(1.05);
}

#audio-play-selected:active:not(:disabled) {
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.15),
                inset -4px -4px 8px rgba(255, 255, 255, 0.3);
    transform: scale(0.98);
}

#audio-play-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(145deg, #E6E9EC, var(--color-bg-dark));
}

#audio-play-selected:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-flat-sm);
}

/* Download buttons - match btn-tool from reference */
#download-selection,
#download-edl,
#download-selected-mp3 {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--color-bg-light), #E6E9EC);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-flat-sm);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

#download-selection:hover:not(:disabled),
#download-edl:hover:not(:disabled),
#download-selected-mp3:hover:not(:disabled) {
    box-shadow: var(--shadow-hover-sm);
    transform: translateY(-1px);
}

#download-selection:active:not(:disabled),
#download-edl:active:not(:disabled),
#download-selected-mp3:active:not(:disabled) {
    box-shadow: var(--shadow-pressed-sm);
    transform: translateY(0);
}

#download-selection:disabled,
#download-edl:disabled,
#download-selected-mp3:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Select all and clear buttons - btn-secondary (tool button style) */
#select-all-sections,
#clear-selection {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--color-bg-light), #E6E9EC);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-flat-sm);
    border: none;
}

#select-all-sections:hover,
#clear-selection:hover {
    box-shadow: var(--shadow-hover-sm);
    transform: translateY(-1px);
}

#select-all-sections:active,
#clear-selection:active {
    box-shadow: var(--shadow-pressed-sm);
    transform: translateY(0);
}

@media (max-width: 768px) {
    .user-info {
        margin-left: 0.5rem;
        gap: 0.5rem;
    }
    
    .user-email {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    .user-menu a {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}

/* Fallback Chat Message Bubble Styles */
.chat-messages .message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    max-width: 100%;
}

.chat-messages .message.user {
    flex-direction: row-reverse;
}

.chat-messages .message-content {
    padding: 12px 16px;
    max-width: 70%;
    word-wrap: break-word;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: #f7fafc;
    color: #2d3748;
}

.chat-messages .message.user .message-content {
    background: var(--color-primary);
    color: white;
    border-radius: 18px 18px 4px 18px;
    border: 1px solid var(--color-primary);
}

.chat-messages .message.assistant .message-content {
    background: #f7fafc;
    color: #2d3748;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #e2e8f0;
}

.chat-messages .message.system .message-content,
.chat-messages .message.error .message-content {
    background: #fef5e7;
    color: #744210;
    border: 1px solid #f6e05e;
    border-radius: 18px;
}

.chat-messages .message-body {
    line-height: 1.5;
}

.chat-messages .message-body p {
    margin: 0 0 8px 0;
}

.chat-messages .message-body p:last-child {
    margin-bottom: 0;
}

.connection-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
}

.connection-status.connected {
    background: #4CAF50;
}

.connection-status.disconnected {
    background: #f44336;
}

.connection-status.error {
    background: #ff9800;
}

.progress-area {
    padding: 10px;
    min-height: 0;
    transition: all 0.3s ease;
    background: var(--color-bg);
}

/* Test mode banner */
.test-mode-banner {
    background: #ff6b35;
    color: white;
    text-align: center;
    padding: 8px;
    font-weight: bold;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Message bubbles */
.user-message, .assistant-message {
    margin: 8px 0;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: var(--color-primary);
    color: white;
    margin-left: auto;
    margin-right: 16px;
    text-align: right;
}

.assistant-message {
    background: #f1f3f4;
    color: #333;
    margin-left: 16px;
    margin-right: auto;
}

.assistant-message.streaming {
    opacity: 0.8;
    border-left: 3px solid #007bff;
}

.assistant-message.system-greeting {
    background: #e8f5e8;
    border-left: 3px solid #4caf50;
}

/* Mapping panel states */
.mapping-loading, .mapping-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.mapping-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    margin: 8px 16px 8px 16px;
    background: #f1f3f4;
    border-radius: 18px 18px 18px 4px;
    max-width: 80px;
    opacity: 0.9;
    animation: fadeIn 0.3s ease-in;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    animation: typingPulse 1.5s infinite;
}

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

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

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

@keyframes typingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1.1);
    }
}

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

@keyframes fadeOut {
    from {
        opacity: 0.9;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.mapping-error i {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 16px;
}

.mapping-loading p, .mapping-error p {
    margin: 0 0 16px 0;
    color: #666;
}

.suggestions-container {
    padding: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--color-bg);
}

/* Suggestion buttons styled like message bubbles */
.suggestion-button {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.suggestion-button:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.2);
}

.suggestion-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tool-progress {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: opacity 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.tool-name {
    font-weight: 600;
    color: #333;
}

.progress-percent {
    color: #666;
}

.progress-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.progress-message {
    font-size: 13px;
    color: #666;
}

.cancel-button {
    background: #f44336;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-button:hover:not(:disabled) {
    background: #d32f2f;
    transform: translateY(-1px);
}

.cancel-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.system-message {
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 14px;
}

.system-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.system-message.error {
    background: #ffebee;
    color: #c62828;
}

.system-message.warning {
    background: #fff8e1;
    color: #f57c00;
}

/* File Upload Widget */
.file-upload-container {
    margin: 16px 0;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    background: #fafafa;
    text-align: center;
    transition: all 0.3s ease;
}

.file-upload-area {
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    background: #f0f0f0;
    border-radius: 8px;
}

.file-upload-area.drag-over {
    background: #e3f2fd;
    border-color: #2196f3;
}

.upload-icon {
    font-size: 48px;
    color: #666;
    margin-bottom: 16px;
}

.upload-text h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.upload-text p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
}

.file-limits {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #888;
}

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Markdown formatting styles within assistant messages */
.assistant-message h1,
.assistant-message h2,
.assistant-message h3,
.assistant-message h4,
.assistant-message h5,
.assistant-message h6 {
    margin: 0.8em 0 0.4em 0;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.3;
}

.assistant-message h1 { font-size: 1.4em; }
.assistant-message h2 { font-size: 1.3em; }
.assistant-message h3 { font-size: 1.2em; }
.assistant-message h4 { font-size: 1.1em; }
.assistant-message h5 { font-size: 1.05em; }
.assistant-message h6 { font-size: 1em; }

.assistant-message p {
    margin: 0.6em 0;
    line-height: 1.5;
}

.assistant-message ul,
.assistant-message ol {
    margin: 0.6em 0;
    padding-left: 1.2em;
}

.assistant-message li {
    margin: 0.2em 0;
    line-height: 1.4;
}

.assistant-message code {
    background: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-size: 85%;
    margin: 0;
    padding: 0.2em 0.4em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #e83e8c;
}

.assistant-message pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 85%;
    line-height: 1.45;
    overflow: auto;
    padding: 16px;
    margin: 0.6em 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.assistant-message pre code {
    background: none;
    border: 0;
    display: inline;
    line-height: inherit;
    margin: 0;
    max-width: auto;
    overflow: visible;
    padding: 0;
    color: #24292e;
}

.assistant-message blockquote {
    border-left: 4px solid #dfe2e5;
    margin: 0.6em 0;
    padding: 0 1em;
    color: #6a737d;
    background: #f6f8fa;
    border-radius: 0 3px 3px 0;
}

.assistant-message strong {
    font-weight: 600;
    color: #2c3e50;
}

.assistant-message em {
    font-style: italic;
    color: #495057;
}

.assistant-message a {
    color: #007bff;
    text-decoration: none;
}

.assistant-message a:hover {
    text-decoration: underline;
}

.assistant-message hr {
    border: none;
    border-top: 1px solid #e1e4e8;
    margin: 1em 0;
}

.assistant-message table {
    border-collapse: collapse;
    margin: 0.6em 0;
    width: 100%;
}

.assistant-message th,
.assistant-message td {
    border: 1px solid #dfe2e5;
    padding: 6px 13px;
    text-align: left;
}

.assistant-message th {
    background: #f6f8fa;
    font-weight: 600;
}

/* Partial Outline Banner */
.partial-outline-banner {
    background: linear-gradient(135deg, #fff3cd, #fff8e1);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.partial-outline-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.partial-outline-banner .banner-icon {
    font-size: 2rem;
    color: #ff9800;
    flex-shrink: 0;
}

.partial-outline-banner .banner-message {
    flex-grow: 1;
}

.partial-outline-banner .banner-message h4 {
    margin: 0 0 0.5rem 0;
    color: #f57c00;
    font-size: 1.1rem;
}

.partial-outline-banner .banner-message p {
    margin: 0;
    color: #5d4037;
    font-size: 0.95rem;
}

.partial-outline-banner .banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.partial-outline-banner .btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.partial-outline-banner .btn-primary {
    background: #ff9800;
    color: white;
}

.partial-outline-banner .btn-primary:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.partial-outline-banner .btn-secondary {
    background: #9e9e9e;
    color: white;
}

.partial-outline-banner .btn-secondary:hover {
    background: #757575;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.partial-outline-banner .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.partial-outline-banner .btn:disabled:hover {
    transform: none;
}


