/* Chat Page Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f3f4f6;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    background: white;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.back-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.header-info h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.125rem;
}

.header-status {
    font-size: 0.85rem;
    color: #6b7280;
}

.header-logo .logo {
    height: 36px;
    width: auto;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Message Bubbles */
.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    align-self: flex-start;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0047AB;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #10b981;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.bot .message-bubble {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: #0047AB;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 0 0.5rem;
}

.message.user .message-time {
    text-align: right;
}

/* System Message */
.system-message {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.system-message-content {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #92400e;
    max-width: 90%;
    text-align: center;
    line-height: 1.5;
}

.system-message-content a {
    color: #0047AB;
    text-decoration: underline;
}

.system-message-content a:hover {
    color: #003580;
}

/* Welcome Message */
.welcome-message {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.welcome-message h2 {
    color: #0047AB;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.welcome-message p {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 80px;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typingBounce 1.4s infinite;
}

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

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

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

/* Chat Input Area */
.chat-input-area {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 900px;
    margin: 0 auto;
}

#message-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    background: #f9fafb;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

#message-input:focus {
    background: white;
    border-color: #0047AB;
    box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.1);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0047AB;
    border: none;
    color: white;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #003580;
    transform: scale(1.05);
}

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

.send-icon {
    display: inline-block;
    transform: translateX(1px);
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-header {
        padding: 0.75rem 1rem;
    }

    .header-info h1 {
        font-size: 1rem;
    }

    .header-status {
        font-size: 0.8rem;
    }

    .header-logo .logo {
        height: 28px;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message {
        max-width: 85%;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .message-bubble {
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
    }

    .chat-input-area {
        padding: 0.75rem 1rem;
    }

    #message-input {
        padding: 0.65rem 0.85rem;
        font-size: 0.9rem;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}
