/* Chat Application Styles */
.chat-app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
}

/* Header */
.chat-header {
    background: var(--color-bg);
    border-bottom: none;
    padding: 16px 0;
    box-shadow: var(--shadow-flat-xs);
}

.chat-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.app-title i {
    color: var(--color-primary);
    margin-right: 8px;
}

.app-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    height: 100%;
    background: var(--color-bg);
}

.message {
    display: flex;
    gap: 12px;
    max-width: 100%;
    margin-bottom: 8px;
}

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

.message.user .message-content {
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-xs) var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.message.assistant .message-content {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-xs);
    border: none;
    box-shadow: var(--shadow-inset);
}

.message.system .message-content {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-sm);
}

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

.message.user .message-avatar {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.message.assistant .message-avatar {
    background: var(--color-surface);
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-inset);
}

.message.system .message-avatar {
    background: var(--color-warning);
    color: var(--color-warning-dark);
    box-shadow: var(--shadow-sm);
}

.message-content {
    padding: 12px 16px;
    max-width: 70%;
    word-wrap: break-word;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
}

.message-author {
    font-weight: 600;
}

.message-time {
    font-size: 0.7rem;
}

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

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

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

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-surface);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.quick-action-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-action-btn:active {
    box-shadow: var(--shadow-inset);
    transform: translateY(0);
}

.quick-action-btn i {
    font-size: 0.875rem;
}

/* File Upload Message */
.file-upload-message {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin: 12px 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: auto;
    padding: 16px;
    border-radius: 8px;
    background: transparent;
}

.file-upload-area:hover {
    background: rgba(49, 130, 206, 0.05);
    border-color: #3182ce;
}

.upload-icon {
    font-size: 3rem;
    color: #3182ce;
    margin-bottom: 8px;
}

.upload-text {
    text-align: center;
    max-width: 400px;
}

.upload-text h4 {
    margin: 0 0 8px 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.upload-text p {
    margin: 0 0 12px 0;
    color: #718096;
    font-size: 0.95rem;
}

.file-limits {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.875rem;
    color: #718096;
    margin-top: 8px;
}

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

/* File Preview Message */
.file-preview-message {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 12px 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.file-icon {
    font-size: 2rem;
    color: #3182ce;
}

.file-details h4 {
    margin: 0 0 4px 0;
    color: #2d3748;
    font-size: 1rem;
}

.file-details p {
    margin: 0;
    color: #718096;
    font-size: 0.875rem;
}

.file-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Progress Message */
.progress-message {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 12px 0;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.progress-icon {
    font-size: 2rem;
    color: #3182ce;
}

.progress-details h4 {
    margin: 0 0 4px 0;
    color: #2d3748;
    font-size: 1rem;
}

.progress-details p {
    margin: 0;
    color: #718096;
    font-size: 0.875rem;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3182ce, #4299e1);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #718096;
}

/* Chat Input */
.chat-input-container {
    border-top: none;
    padding: 16px 20px;
    box-shadow: none;
}

.chat-input-wrapper {
    border-radius: var(--radius-2xl);
    padding: 16px 20px;
    background: var(--color-bg);
    box-shadow: var(--shadow-flat-sm);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-input-wrapper:hover {
    box-shadow: var(--shadow-hover-sm);
}

.chat-input-wrapper:focus-within {
    box-shadow: var(--shadow-pressed-sm);
}

.chat-input-wrapper > div:first-child {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.chat-input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#chat-input,
#message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--color-text-primary);
    background: transparent;
    resize: none;
    line-height: 1.4;
    max-height: 120px;
    padding: 0;
    font-family: inherit;
}

#chat-input::placeholder,
#message-input::placeholder {
    color: var(--color-text-placeholder);
}

.chat-input-footer {
    font-size: 11px;
    color: var(--color-text-placeholder);
}

.char-count {
    color: #718096;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
}

.btn-primary {
    background: var(--color-primary-gradient);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-flat-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-hover-sm);
    transform: translateY(-2px);
}

.btn-primary:active {
    box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.15),
                inset -4px -4px 8px rgba(255, 255, 255, 0.3);
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(145deg, var(--color-bg-light), #E6E9EC);
    color: var(--color-text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-flat-sm);
}

.btn-secondary:hover {
    box-shadow: var(--shadow-hover-sm);
    transform: translateY(-1px);
}

.btn-secondary:active {
    box-shadow: var(--shadow-pressed-sm);
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: #3182ce;
    border-color: #3182ce;
}

.btn-outline:hover {
    background: #3182ce;
    color: white;
}

/* Send button - matches reference send-btn */
#send-button,
.send-btn,
.btn-icon {
    width: 40px;
    height: 40px;
    background: var(--color-primary-gradient);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--transition-base);
    box-shadow: 4px 4px 8px var(--color-bg-dark),
                -4px -4px 8px var(--color-bg-light);
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

#send-button:hover,
.send-btn:hover,
.btn-icon:hover {
    transform: scale(1.1);
}

#send-button:active,
.send-btn:active,
.btn-icon:active {
    transform: scale(0.9);
}

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

/* Drag and Drop */
.drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(49, 130, 206, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.drag-content {
    background: white;
    border: 2px dashed #3182ce;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
}

.drag-icon {
    font-size: 4rem;
    color: #3182ce;
    margin-bottom: 16px;
}

.drag-content h3 {
    margin: 0 0 8px 0;
    color: #2d3748;
}

.drag-content p {
    margin: 0;
    color: #718096;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.loading-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Toast Notifications */
.error-toast,
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    min-width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.error-toast {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.success-toast {
    background: #c6f6d5;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}

.toast-content i {
    font-size: 1.2rem;
}

.toast-content span {
    flex: 1;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-input-container {
        padding: 12px;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .app-title {
        font-size: 1.25rem;
    }
    
    .file-upload-message,
    .file-preview-message,
    .progress-message {
        padding: 16px;
    }
    
    .upload-actions,
    .file-actions {
        flex-direction: column;
    }
} 