/* AI Author Chat Interface Styles */

.ai-author-chat-container {
    margin: 3rem 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Chat Header */
.chat-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.chat-author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.author-details h3 {
    color: white;
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.author-expertise {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
}

.chat-toggle-btn {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn:active {
    transform: translateY(0);
}

.toggle-icon {
    font-size: 1.1rem;
}

/* Chat Body */
.chat-body {
    background: white;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 400px;
    background: #f8f9fa;
}

.welcome-message {
    margin-bottom: 1rem;
}

.message-bubble {
    margin-bottom: 1rem;
    max-width: 80%;
    animation: fadeInUp 0.3s ease;
}

.message-bubble.user-message {
    margin-left: auto;
}

.message-bubble.author-message {
    margin-right: auto;
}

.message-content {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    position: relative;
    line-height: 1.5;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 4px;
}

.author-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-content p {
    margin: 0 0 0.75rem 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content em {
    font-style: italic;
    color: #666;
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.user-message .message-meta {
    justify-content: flex-end;
    color: rgba(255, 255, 255, 0.8);
}

.author-message .message-meta {
    color: #666;
}

.author-name {
    font-weight: 600;
}

.message-time {
    font-size: 0.75rem;
}

/* Chat Input */
.chat-input-container {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e9ecef;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input::placeholder {
    color: #adb5bd;
}

.send-message-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.send-message-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.send-message-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-icon {
    font-size: 1.1rem;
}

.chat-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #666;
}

.input-hint {
    font-style: italic;
}

.character-count {
    font-weight: 500;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.send-message-btn:disabled .send-icon {
    animation: pulse 1.5s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-author-chat-container {
        margin: 2rem 0;
        border-radius: 12px;
    }
    
    .chat-header {
        padding: 1rem;
    }
    
    .chat-header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .chat-author-info {
        flex-direction: column;
        text-align: center;
    }
    
    .chat-toggle-btn {
        width: 100%;
        justify-content: center;
    }
    
    .chat-messages {
        padding: 1rem;
        max-height: 300px;
    }
    
    .message-bubble {
        max-width: 90%;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .send-message-btn {
        width: 100%;
        height: 45px;
        border-radius: 12px;
    }
    
    .chat-input-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chat-body {
        background: #1a1a1a;
    }
    
    .chat-messages {
        background: #2d2d2d;
    }
    
    .author-message .message-content {
        background: #3a3a3a;
        color: #e0e0e0;
        border-color: #4a4a4a;
    }
    
    .chat-input {
        background: #2d2d2d;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }
    
    .chat-input:focus {
        border-color: #667eea;
    }
    
    .chat-input::placeholder {
        color: #888;
    }
    
    .chat-input-container {
        background: #1a1a1a;
        border-top-color: #4a4a4a;
    }
    
    .chat-input-footer {
        color: #888;
    }
}

/* Accessibility */
.chat-toggle-btn:focus,
.send-message-btn:focus,
.chat-input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ai-author-chat-container {
        border: 2px solid #000;
    }
    
    .message-bubble {
        border: 1px solid #000;
    }
    
    .chat-input {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .message-bubble,
    .chat-toggle-btn,
    .send-message-btn {
        animation: none;
        transition: none;
    }
}



