/* NH AI Driver's Ed Instructor - Chat Widget Styles (Inline Version) */

/* Configuration Notice */
.nh-ai-notice {
    background: #fff3cd;
    color: #856404;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin: 20px 0;
    font-size: 15px;
}

/* Inline Chat Widget Container */
.nh-ai-chat-widget-inline {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    height: 650px;
    display: flex;
    flex-direction: column;
}

/* Chat Window (Inline - always visible) */
.nh-chat-window-inline {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat Header */
.nh-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.nh-chat-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nh-chat-header .instructor-avatar {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.nh-chat-header .header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.nh-chat-header .status-text {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Messages Area */
.nh-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 30px;
    background: #f8f9fa;
    scroll-behavior: smooth;
    min-height: 400px;
    max-height: 500px;
}

.nh-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 75%;
}

.instructor-message .message-content {
    border-bottom-left-radius: 4px;
}

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

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.message-content strong {
    font-weight: 600;
}

/* Welcome Message */
.welcome-message .message-content {
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    border-left: 4px solid #667eea;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 10px;
    padding: 0 20px 10px 20px;
    background: #f8f9fa;
}

.typing-dots {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    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;
    }
}

/* Input Area */
.nh-chat-input-area {
    background: white;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

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

/* Quick Questions */
.quick-questions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.quick-question {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-question:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .nh-ai-chat-widget-inline {
        margin: 10px;
        border-radius: 12px;
        height: 500px;
    }
    
    .nh-chat-messages {
        min-height: 300px;
        max-height: 350px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-questions {
        flex-direction: column;
    }
    
    .quick-question {
        white-space: normal;
        text-align: left;
    }
}

/* Error Message */
.error-message {
    background: #fee;
    color: #c33;
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 4px solid #c33;
    margin: 0 20px 16px 20px;
    font-size: 14px;
}

/* Loading State */
.send-btn.loading {
    pointer-events: none;
}

.send-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
