/* ======================
   Chat Interface Styles
   ====================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 600px;
    background: white;
    position: relative;
    margin: 0 auto;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #6F7B55, #556B2F);
    color: white;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
    position: sticky;
    top: 0;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
        margin: 0;
    }
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-restart-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.header-restart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.logo-icon {
    font-size: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

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

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    position: relative;
    max-width: 100%;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

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

/* Welcome Screen */
.welcome-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
    padding: 20px;
}

.welcome-content {
    max-width: 320px;
}

.welcome-icon {
    font-size: 60px;
    margin-bottom: 24px;
    animation: bounce 2s infinite;
}

.welcome-content h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 16px;
    font-weight: 700;
}

.welcome-content p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

/* Brand Title & Tagline */
.brand-title {
    font-size: 32px;
    color: #333;
    letter-spacing: 0.25em;
    margin-bottom: 20px;
    font-weight: 700;
}

.tagline {
    color: #333;
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 24px;
    font-weight: 500;
}

/* Chat Messages */
.message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-in;
    max-width: 100%;
}

/* Standalone Content (without message wrapper) */
.standalone-content {
    margin: 16px 0;
    animation: slideUp 0.3s ease-out;
}

/* Inline Actions (under messages) */
.inline-actions {
    animation: slideUp 0.3s ease-out;
}

.inline-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-action-button {
    background: white;
    border: 2px solid #6F7B55;
    color: #6F7B55;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.inline-action-button:hover {
    background: #6F7B55;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(111, 123, 85, 0.3);
}

.inline-action-button.primary {
    background: #6F7B55;
    color: white;
}

.inline-action-button.primary:hover {
    background: #556B2F;
    border-color: #556B2F;
}

.inline-action-button .emoji {
    font-size: 16px;
}

.message-bot {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6F7B55, #556B2F);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 4px;
}

.message-content {
    background: #F4F7EE; /* pale green */
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    max-width: 280px;
    word-wrap: break-word;
    color: #40482F;
}

.message-user .message-content {
    background: #C9D1B4; /* darker olive */
    color: #40482F;
}

.message-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: inherit;
}

.message-content p {
    font-size: 14px;
    line-height: 1.4;
    color: inherit;
    opacity: 0.9;
}

/* Chat Actions */
.chat-actions {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    max-width: 100%;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

/* File Upload Area */
.file-upload-area {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.upload-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.upload-header {
    text-align: center;
    margin-bottom: 24px;
}

.upload-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.upload-header p {
    color: #666;
    font-size: 14px;
}

.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
    position: relative;
}

.upload-zone:hover {
    border-color: #6F7B55;
    background: #fafafa;
}

.upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.upload-icon {
    font-size: 32px;
    opacity: 0.6;
}

.upload-text span:last-child {
    color: #666;
    font-size: 14px;
}

.uploaded-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.uploaded-file {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

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

.file-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.upload-actions button {
    flex: 1;
}

/* Typing Indicator */
.typing-indicator {
    position: absolute;
    bottom: 80px;
    left: 16px;
    background: white;
    padding: 8px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 50;
}

.typing-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-avatar {
    font-size: 14px;
}

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

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: typingDots 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDots {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive Design */
@media (min-width: 768px) {
    .chat-container {
        max-width: 600px;
        margin: 0 auto;
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-messages {
        padding: 24px;
    }
    
    .message-content {
        max-width: 360px;
        padding: 16px 20px;
    }
    
    .welcome-content {
        max-width: 400px;
    }
    
    .welcome-icon {
        font-size: 80px;
    }
    
    .upload-content {
        max-width: 500px;
        padding: 32px;
    }
    
    .brand-title {
        font-size: 40px;
    }
    
    .tagline {
        font-size: 24px;
    }
}

@media (min-width: 1024px) {
    .chat-container {
        max-width: 550px;
        height: 90vh;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    }
    
    .chat-header {
        border-radius: 16px 16px 0 0;
    }
}