﻿.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f7f7f8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Content Area */
.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 20px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column-reverse;
}

.messages-wrapper {
    min-width: 1000px;
    max-width: 1200px;
    margin: auto auto 0 auto;
    padding: 20px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Message Groups */
.message-group {
    margin-bottom: 24px;
}

.user-message {
    /* User messages don't need special background */
}

.assistant-message {
    background: #f7f7f8;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.message-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Message Avatars */
.message-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.user-avatar,
.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-avatar {
    background: #19c37d;
    color: white;
}

.ai-avatar {
    background: #0775e8;
    color: white;
}

/* Message Text */
.message-text {
    flex: 1;
    min-width: 0;
    
    background-color: white;
    padding: 15px;
    box-shadow: 0 0.2px 0.5px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.message-body {
    color: #374151;
    line-height: 1.6;
    font-size: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-data {
    margin-top: 12px;
}

.data-preview {
    color: #6b7280;
    font-style: italic;
}

.message-time {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

/* Input Area */
.chat-input-container {
    background: #f7f7f8;
    border-top: 1px solid #e5e7eb;
    padding: 20px;
}

.input-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.input-area {
    position: relative;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* overflow: hidden; */
}

.chat-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    padding: 16px 50px 16px 16px;
    font-size: 16px;
    line-height: 1.5;
    background: transparent;
    max-height: 200px;
    min-height: 24px;
}

    .chat-textarea:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.send-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #082e4f ;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

    .send-button:hover:not(:disabled) {
        color: #0d8f6f;
        background-color: #f9f9f9;
        animation: fadeIn 1.5s ease-in-out infinite;
    }

    .send-button:disabled {
        display: none;
        animation: fadeOut 0.5s forwards;
        /* color: #d1d5db;
        cursor: not-allowed; */
    }






.voice-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #082e4f ;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

    .voice-button:hover:not(:disabled) {
        background: #e9ecef;
        border-color: #ced4da;
        animation: fadeIn 1.5s ease-in-out infinite;
    }

    .voice-button.recording {
        color: red;
        background-color: #f9f9f9;
        border-color: red;
        animation: fadeIn 1.5s ease-in-out infinite;
        
    }

    .voice-button:disabled {
        display: none;
        animation: fadeOut 0.5s forwards;
    }




    

.input-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.action-button {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

    .action-button:hover:not(:disabled) {
        background: #f9fafb;
        border-color: #9ca3af;
    }

    .action-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Welcome Screen */
.welcome-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin-bottom: 10%;
}

.welcome-content {
    max-width: 800px;
    text-align: center;
}

.welcome-header {
    margin-bottom: 48px;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.welcome-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin: 0;
}

.example-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-width: 768px;
    margin: 0 auto;
}

.prompt-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
}

    .prompt-card:hover {
        border-color: #d1d5db;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

.prompt-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.prompt-text {
    flex: 1;
}

.prompt-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.prompt-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 8px 0;
}

    .typing-indicator span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #9ca3af;
        animation: typing 1.4s infinite ease-in-out;
    }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typing {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .messages-wrapper {
        padding: 16px;
    }

    .chat-input-container {
        padding: 16px;
    }

    .assistant-message {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .example-prompts {
        grid-template-columns: 1fr;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .chat-header-content {
        /* flex-direction: column;  */
        gap: 12px;
        align-items: flex-start;
    }

    .chat-actions {
        align-self: stretch;
    }

    .title-edit-input {
        font-size: 1.125rem;
        min-width: auto;
        width: 100%;
    }

    .title-display-container .chat-title {
        font-size: 1.125rem;
    }
}

/* Chat Header Styles */
.chat-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 10px;
    flex-shrink: 0;
}

.chat-header-content {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    /* align-items: center; */
    justify-content: space-between;
    gap: 20px;
}

.chat-title-section {
    flex: 1;
    min-width: 0;
}

.chat-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Title editing styles */
.title-display-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-edit-button {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
}

.title-display-container:hover .title-edit-button {
    opacity: 1;
    transform: scale(1);
}

.title-edit-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.title-edit-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.title-edit-input {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    padding: 4px 8px;
    outline: none;
    font-family: inherit;
    min-width: 200px;
}

    .title-edit-input:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.title-edit-actions {
    display: flex;
    gap: 4px;
}

.title-action-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .title-action-button.save {
        color: #059669;
    }

        .title-action-button.save:hover {
            background: #ecfdf5;
            color: #047857;
        }

    .title-action-button.cancel {
        color: #dc2626;
    }

        .title-action-button.cancel:hover {
            background: #fef2f2;
            color: #b91c1c;
        }

.chat-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.participant-count,
.online-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.online-indicator {
    color: #10b981;
    font-weight: 500;
}

    .online-indicator::before {
        content: '';
        width: 8px;
        height: 8px;
        background: #10b981;
        border-radius: 50%;
        display: inline-block;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.header-action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

    .header-action-button:hover {
        background: #f9fafb;
        border-color: #9ca3af;
        color: #1f2937;
    }

    .header-action-button:active {
        transform: translateY(1px);
    }

    .header-action-button svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close-button {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .modal-close-button:hover {
        background: #f3f4f6;
        color: #374151;
    }

.modal-body {
    padding: 20px 24px;
}

.modal-description {
    color: #6b7280;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.share-email-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: border-color 0.2s;
}

    .share-email-input:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.email-help-text {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px 20px 24px;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

    .btn-primary:hover:not(:disabled) {
        background: #2563eb;
        border-color: #2563eb;
    }

.btn-secondary {
    background: white;
    color: #374151;
    border-color: #d1d5db;
}

    .btn-secondary:hover:not(:disabled) {
        background: #f9fafb;
        border-color: #9ca3af;
    }

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}



.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

    .typing-indicator span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #666;
        animation: typing 1.4s infinite ease-in-out;
    }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

.status-panel-button {
    position: relative;
}

.status-panel-button .status-pill {
    margin-left: 6px;
}

.status-pill {
    background: #f97316;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 0 8px;
    line-height: 1.5;
    min-width: 24px;
    text-align: center;
}

.processing-status-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1090;
}

.processing-status-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.processing-status-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100%);
    height: 100%;
    background: #fff;
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.35);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 1100;
    display: flex;
    flex-direction: column;
}

.processing-status-panel.open {
    transform: translateX(0);
}

.processing-status-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.processing-status-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.processing-status-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
}

.processing-status-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

.processing-status-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    padding: 6px;
    transition: background 0.2s;
}

    .processing-status-close:hover {
        background: #f3f4f6;
        color: #111827;
    }

.processing-status-body {
    padding: 8px 24px 32px 24px;
    overflow-y: auto;
    flex: 1;
}

.processing-status-empty {
    padding: 32px 16px;
    text-align: center;
    color: #6b7280;
}

    .processing-status-empty h4 {
        margin-bottom: 8px;
        font-size: 1rem;
        color: #0f172a;
    }

.processing-status-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.processing-status-step {
    position: relative;
    padding-left: 24px;
    margin-left: 8px;
    border-left: 2px solid #e5e7eb;
    padding-bottom: 18px;
}

    .processing-status-step:last-child {
        padding-bottom: 0;
    }

    .processing-status-step::before {
        content: "";
        position: absolute;
        left: -7px;
        top: 10px;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #cbd5f5;
        border: 2px solid currentColor;
    }

.processing-status-step-header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.processing-status-stage {
    font-weight: 600;
    color: #0f172a;
}

.status-tag {
    font-size: 12px;
    text-transform: capitalize;
    background: #e2e8f0;
    color: #0f172a;
    padding: 2px 8px;
    border-radius: 999px;
}

.status-tag-final {
    background: #0f172a;
    color: #fff;
}

.processing-status-message {
    margin: 0 0 6px 0;
    color: #334155;
    line-height: 1.4;
}

.processing-status-meta {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    gap: 12px;
}

.processing-status-step.accent-thinking {
    color: #6366f1;
}

.processing-status-step.accent-reasoning {
    color: #0ea5e9;
}

.processing-status-step.accent-fetching {
    color: #10b981;
}

.processing-status-step.accent-finalizing {
    color: #f97316;
}

@media (max-width: 768px) {
    .processing-status-panel {
        width: 100%;
    }
}
