/* AI Lesson Assistant Styles */

/* Chat Messages */
.chat-message {
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in;
}

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

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

.chat-message.ai {
    display: flex;
    justify-content: flex-start;
}

.chat-message.system {
    display: flex;
    justify-content: center;
}

.message-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
}

.message-bubble.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message-bubble.ai {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #212529;
    border-bottom-left-radius: 0.25rem;
}

.message-bubble.system {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    font-style: italic;
    font-size: 0.875rem;
    max-width: 85%;
    text-align: center;
}

.message-time {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: block;
}

.message-bubble.user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Resource Cards */
.resource-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.resource-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.resource-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-right: 0.75rem;
}

.resource-icon i {
    font-size: 1.25rem;
}

.resource-icon.pdf {
    background: #fef3f2;
    color: #dc3545;
}

.resource-icon.doc {
    background: #f0f7ff;
    color: #0d6efd;
}

.resource-icon.video {
    background: #f3f0ff;
    color: #6f42c1;
}

.resource-icon.txt {
    background: #f0fdf4;
    color: #198754;
}

.resource-info {
    flex-grow: 1;
    min-width: 0;
}

.resource-name {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-size {
    font-size: 0.75rem;
    color: #6c757d;
}

.resource-remove {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Drag and Drop Zone */
#dropZone {
    transition: all 0.3s;
}

#dropZone:hover {
    border-color: #667eea !important;
    background-color: #f8f9ff !important;
}

#dropZone.drag-over {
    border-color: #667eea !important;
    background-color: #f0f3ff !important;
    transform: scale(1.02);
}

/* Typing Indicator */
.typing-dots {
    display: inline-flex;
    gap: 0.25rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Preview Panel */
#lessonPreview {
    font-size: 0.875rem;
}

#lessonPreview h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #212529;
}

#lessonPreview h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #495057;
}

#lessonPreview h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #6c757d;
}

#lessonPreview p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

#lessonPreview ul, #lessonPreview ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

#lessonPreview code {
    background: #f8f9fa;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
}

#lessonPreview pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* Quick Actions */
#quickActions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Scrollbar Styling */
#chatMessages::-webkit-scrollbar,
#aiSidebar::-webkit-scrollbar,
#previewPanel::-webkit-scrollbar {
    width: 8px;
}

#chatMessages::-webkit-scrollbar-track,
#aiSidebar::-webkit-scrollbar-track,
#previewPanel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatMessages::-webkit-scrollbar-thumb,
#aiSidebar::-webkit-scrollbar-thumb,
#previewPanel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#chatMessages::-webkit-scrollbar-thumb:hover,
#aiSidebar::-webkit-scrollbar-thumb:hover,
#previewPanel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #aiSidebar {
        display: none;
    }
    
    #previewPanel {
        display: none;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

/* Loading Animation */
.loading-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Success/Error States */
.message-bubble.success {
    background: #d1e7dd;
    border-color: #198754;
    color: #0f5132;
}

.message-bubble.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #842029;
}

/* Markdown Content Styling */
.markdown-content {
    line-height: 1.7;
}

.markdown-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
}

.markdown-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.markdown-content table th,
.markdown-content table td {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

.markdown-content table th {
    background: #f8f9fa;
    font-weight: 600;
}
