/* ============================================
   AI GENERATION + CHAT STYLES - TEACHER LABS
   Include after teacher-labs-shared.css
   ============================================ */

/* File Upload Dropzone - THE MISSING STYLES! */
.file-upload-dropzone {
    background: white;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.file-upload-dropzone:hover {
    border-color: var(--brand);
    background: #f8fbff;
}

.file-upload-dropzone.drag-over {
    border-color: var(--brand);
    background: #f0f5fa;
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--brand);
}

.file-upload-instructions {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.file-upload-instructions strong {
    color: var(--brand);
    font-weight: 600;
}

.file-upload-types {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Uploaded Files List */
#uploadedFilesList {
    margin-top: 10px;
}

#uploadedFilesList p {
    color: #78350f;
    font-size: 0.85rem;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.file-icon {
    font-size: 1.2rem;
}

.file-name {
    flex: 1;
    color: var(--ink);
    font-weight: 500;
    word-break: break-word;
}

.file-size {
    font-size: 0.75rem;
    color: var(--muted);
}

.file-remove {
    background: #fee2e2;
    border: none;
    color: #dc2626;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    background: #fecaca;
}

/* Import/Quick Start Section */
.import-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.import-section h4 {
    margin: 0 0 8px 0;
    color: #0369a1;
    font-size: 1.1rem;
    font-weight: 700;
}

.import-section p {
    margin: 0 0 12px 0;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
}

.import-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.2);
}

.import-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.3);
}

.import-btn:active {
    transform: translateY(0);
}

/* ============================================
   TEACHER CHAT INTERFACE STYLES
   ============================================ */

/* Teacher AI Chat Modal */
.teacher-ai-chat {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.teacher-chat-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1200px;
    max-height: 92vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Header - Teacher Labs Colors */
.teacher-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--brand) 0%, #254a7f 100%);
    color: white;
    gap: 12px;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-icon {
    font-size: 1.4rem;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-minimize,
.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.8rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.chat-minimize:hover,
.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Minimized Chat State */
.teacher-chat-container.minimized {
    width: 320px;
    height: 56px;
    max-width: 320px;
    max-height: 56px;
    top: auto;
    bottom: 20px;
    right: 20px;
    left: auto;
    transform: none;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(47, 93, 159, 0.3);
    border: 2px solid var(--brand);
}

.teacher-chat-container.minimized:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(47, 93, 159, 0.4);
    transform: translateY(-2px);
}

.teacher-chat-container.minimized .chat-messages,
.teacher-chat-container.minimized .chat-input-area {
    display: none;
}

.teacher-chat-container.minimized .teacher-chat-header {
    cursor: pointer;
    padding: 12px 16px;
}

.teacher-chat-container.minimized .chat-download-btns {
    display: none !important;
}

.teacher-chat-container.minimized .chat-title {
    font-size: 1rem;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F6F8FC;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 90%;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.teacher-message {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.sage-message {
    align-self: flex-start;
    align-items: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 1rem;
}

.teacher-message .message-content {
    background: linear-gradient(135deg, var(--brand), #254a7f);
    color: white;
}

.sage-message .message-content {
    background: white;
    color: var(--ink);
    border: 2px solid var(--border);
    padding: 16px 20px;
}

/* Message Action Buttons Container */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Message Action Buttons (Download, Copy, Print) */
.message-action-btn {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-action-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.message-action-btn:active {
    transform: translateY(0);
}

/* Download Word Button - Primary Blue Style */
.message-action-btn.download-word {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    color: white;
}

.message-action-btn.download-word:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Legacy Message Copy Button (backward compatibility) */
.message-copy-btn {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.message-copy-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.message-copy-btn:active {
    transform: translateY(0);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    border: 2px solid var(--border);
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    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(-10px);
    }
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-top: 2px solid var(--border);
    align-items: flex-end;
}

.chat-file-btn,
.chat-mic-btn {
    background: #E6EDF6;
    border: 2px solid var(--brand);
    color: var(--brand);
    font-size: 1.4rem;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-file-btn:hover,
.chat-mic-btn:hover {
    background: var(--brand);
    color: white;
    transform: translateY(-1px);
}

/* Mic button listening state */
.chat-mic-btn.listening {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Uploaded files in chat */
.chat-uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

.chat-file-item .file-icon {
    font-size: 1.1rem;
}

.chat-file-item .file-name {
    color: var(--ink);
    font-weight: 500;
}

.chat-file-item .file-size {
    color: var(--muted);
    font-size: 0.75rem;
}

.chat-file-item .file-remove {
    background: #fee2e2;
    border: none;
    color: #dc2626;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.chat-file-item .file-remove:hover {
    background: #fecaca;
}

#teacherChatInput {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    line-height: 1.4;
    min-height: 28px;
    max-height: 120px;
}

#teacherChatInput:focus {
    outline: none;
    border-color: var(--brand);
}

.chat-send-btn {
    background: var(--brand);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    height: 48px;
}

.chat-send-btn:hover {
    background: #254a7f;
    transform: translateY(-1px);
}

.send-icon {
    font-size: 1.2rem;
    line-height: 1;
}

/* Download Buttons */
.chat-download-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.download-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Chat Tip */
.chat-tip {
    font-size: 0.8rem;
    color: white;
    font-weight: 600;
    margin-left: 16px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    white-space: nowrap;
    cursor: help;
}

/* Chat Footer */
.chat-footer {
    padding: 12px 20px;
    background: #F6F8FC;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* Toast Notification Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .teacher-chat-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    /* Hide download buttons on mobile - they clutter the header */
    .chat-download-btns {
        display: none !important;
    }
    
    /* More compact header on mobile */
    .teacher-chat-header {
        padding: 12px 16px;
    }
    
    .chat-title {
        font-size: 1rem;
    }
    
    .chat-icon {
        font-size: 1.2rem;
    }
    
    /* Smaller header buttons */
    .chat-minimize,
    .chat-close {
        width: 32px;
        height: 32px;
        font-size: 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-input-area {
        padding: 12px 16px;
    }
    
    .chat-send-btn {
        padding: 12px 16px;
    }
    
    .chat-tip {
        display: none !important; /* Hide tip on mobile */
    }

    .file-upload-dropzone {
        padding: 16px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #E6EDF6;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--brand);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #254a7f;
}

/* ============================================
   END OF STYLES
   ============================================ */