/* AI Chat - Page Version Only */

.ai-chat-page {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    box-sizing: border-box;
}

.ai-chat-page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ai-chat-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-chat-page-description {
    color: #94a3b8;
    font-size: 1.1rem;
}

.ai-chat-container {
    background: #1e293b;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 500px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-chat-message {
    display: flex;
    gap: 10px;
    max-width: 75%;
}

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

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

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

.ai-chat-content {
    background: #334155;
    padding: 16px 20px;
    border-radius: 16px;
    color: #f1f5f9;
    font-size: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-chat-content.error {
    background: #7f1d1d;
    border: 1px solid #ef4444;
}

.ai-chat-message-user .ai-chat-content {
    background: #3b82f6;
}

.ai-chat-content.typing::after {
    content: '...';
    animation: typing 1s infinite;
}

@keyframes typing {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.ai-chat-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-chat-content li {
    margin: 5px 0;
}

/* Markdown Table Styles */
.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

.ai-table th,
.ai-table td {
    padding: 10px 15px;
    border: 1px solid #475569;
    text-align: left;
}

.ai-table th {
    background: #1e40af;
    color: white;
    font-weight: 600;
}

.ai-table tr:nth-child(even) td {
    background: #334155;
}

.ai-table a {
    color: #60a5fa;
    text-decoration: underline;
}

.ai-chat-content strong {
    color: #f1f5f9;
    font-weight: 700;
}

.ai-chat-content code {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #f97316;
}

.ai-chat-content h1,
.ai-chat-content h2,
.ai-chat-content h3 {
    margin: 15px 0 10px 0;
    color: #f1f5f9;
}

.ai-chat-content h1 { font-size: 24px; }
.ai-chat-content h2 { font-size: 20px; }
.ai-chat-content h3 { font-size: 18px; }

.ai-chat-form {
    padding: 20px;
    background: #0f172a;
    border-top: 1px solid #334155;
    display: flex;
    gap: 12px;
}

.ai-chat-form input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #334155;
    border-radius: 24px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-form input:focus {
    border-color: #3b82f6;
}

.ai-chat-form input::placeholder {
    color: #94a3b8;
}

.ai-chat-form button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3b82f6;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.ai-chat-form button:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.ai-chat-form button:disabled {
    background: #64748b;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

/* Full width on larger screens */
@media (min-width: 1200px) {
    .ai-chat-container {
        max-width: 900px;
        margin: 0 auto;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-chat-page {
        padding: 1rem;
    }
    
    .ai-chat-page-title {
        font-size: 1.8rem;
    }
    
    .ai-chat-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .ai-chat-message {
        max-width: 90%;
    }
    
    .ai-chat-content {
        font-size: 14px;
        padding: 12px 16px;
    }
}
