/* Chat Dialog Styles */
.chat-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.chat-dialog-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    height: 80%;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.chat-header-content {
    flex: 1;
}

.chat-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.chat-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 400;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

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

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: #007bff;
    color: white;
}

.chat-message.ai .chat-message-avatar {
    background: #28a745;
    color: white;
}

.chat-message-content {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 70%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-message.user .chat-message-content {
    background: #007bff;
    color: white;
}

.chat-message.ai .chat-message-content {
    background: white;
    color: #333;
}

/* Chat Message Text with Markdown Support */
.chat-message-text {
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Markdown Content Styling */
.chat-message-text h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #3498db;
}

.chat-message-text h4 {
    color: #34495e;
    font-size: 1rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem 0;
}

.chat-message-text p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.chat-message-text ul, .chat-message-text ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chat-message-text li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.chat-message-text strong, .chat-message-text b {
    font-weight: 600;
    color: #2c3e50;
}

.chat-message-text em, .chat-message-text i {
    font-style: italic;
    color: #7f8c8d;
}

.chat-message-text blockquote {
    border-left: 4px solid #3498db;
    margin: 0.75rem 0;
    padding-left: 1rem;
    color: #7f8c8d;
    font-style: italic;
}

.chat-message-text code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e74c3c;
}

.chat-message-text pre {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
}

.chat-message-text pre code {
    background: none;
    padding: 0;
    color: #2c3e50;
}

/* Special styling for AI messages with markdown */
.chat-message.ai .chat-message-text h3 {
    color: #27ae60;
    border-bottom-color: #27ae60;
}

.chat-message.ai .chat-message-text strong {
    color: #27ae60;
}

.chat-message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Common Questions Collapsible */
.common-questions-section {
    background: white;
    border-top: 1px solid #e9ecef;
}

.common-questions-toggle {
    width: 100%;
    background: #f8f9fa;
    border: none;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

.common-questions-toggle:hover {
    background: #e9ecef;
}

.toggle-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: #6c757d;
}

.common-questions-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.common-questions-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: white;
}

.common-questions-content.open {
    max-height: 200px;
    transition: max-height 0.3s ease-in;
}

.common-questions-grid {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.common-question-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
    color: #495057;
    font-weight: 500;
}

.common-question-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.common-question-btn:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .common-questions-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .common-question-btn {
        padding: 1rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .common-questions-content.open {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .common-questions-toggle {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .common-question-btn {
        padding: 1.25rem 1rem;
        font-size: 0.9rem;
    }
}

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

.chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #007bff;
}

.chat-send-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #0056b3;
}

.chat-send-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Loading Animation */
.chat-typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-dialog-container {
        width: 95%;
        height: 90%;
        max-height: none;
    }
    
    .chat-message-content {
        max-width: 85%;
    }
    
    .chat-quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        text-align: center;
    }

    /* Responsive markdown */
    .chat-message-text h3 {
        font-size: 1rem;
    }
    
    .chat-message-text h4 {
        font-size: 0.9rem;
    }
    
    .chat-message-text ul, .chat-message-text ol {
        padding-left: 1rem;
    }
} 