/* ===== ENHANCED CHAT UI STYLES ===== */

/* Discovery CTA - ChatGPT Style */
.chat-elements-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.chat-window-title {
    font-size: 2rem;
    color: #e1e5e9;
    margin-bottom: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #e1e5e9, #00f5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-window-subtitle {
    font-size: 1rem;
    color: #a0a9b8;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.chat-window-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.chat-window-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 245, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 245, 255, 0.15);
}

.input-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.input-placeholder {
    color: #a0a9b8;
    font-size: 0.95rem;
    text-align: left;
    flex: 1;
}

.input-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00f5ff, #0099cc);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

/* Suggestion Cards */
.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.suggestion-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.suggestion-card:hover,
.suggestion-card:focus {
    background: rgba(0, 245, 255, 0.08);
    border-color: rgba(0, 245, 255, 0.3);
    transform: translateX(4px);
    outline: none;
}

.suggestion-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.2);
}

.suggestion-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 245, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00f5ff;
    flex-shrink: 0;
}

.suggestion-text {
    color: #e1e5e9;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Message Header with Timestamp */
.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.message-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: #e1e5e9;
}

.message-time {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Message Actions */
.message-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-group:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #a0a9b8;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 245, 255, 0.3);
    color: #00f5ff;
    transform: scale(1.1);
}

.action-btn.active {
    background: rgba(0, 245, 255, 0.15);
    border-color: rgba(0, 245, 255, 0.3);
    color: #00f5ff;
}

.feedback-btn.active.feedback-good {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.3);
}

.feedback-btn.active.feedback-bad {
    color: #f44336;
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.3);
}

/* Message Group Styles */
.message-group {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: messageSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.message-group.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-group.assistant {
    align-self: flex-start;
}

/* Avatar Styles */
.avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xophia-avatar {
    background: linear-gradient(135deg, #00f5ff, #0099cc);
    color: white;
}

.user-avatar {
    background: linear-gradient(135deg, #666, #444);
    color: white;
}

/* Metadata Badges */
.metadata-badge {
    display: inline-block;
    background: rgba(0, 245, 255, 0.1);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 12px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: #00f5ff;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(0, 245, 255, 0.95);
    color: #0f1419;
    padding: 0.875rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 245, 255, 0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100000;
    max-width: 300px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.toast-error {
    background: rgba(244, 67, 54, 0.95);
    color: white;
    box-shadow: 0 8px 32px rgba(244, 67, 54, 0.4);
}

.toast.toast-success {
    background: rgba(76, 175, 80, 0.95);
    color: white;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.4);
}

/* Enhanced Typing Indicator */
.typing-message {
    animation: messageSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.typing-indicator {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    display: flex;
    gap: 6px;
    align-items: center;
}

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

.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);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Improved Chat Footer */
.chat-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 245, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
}

.chat-textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: #e1e5e9;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    padding: 0.5rem;
    max-height: 120px;
    min-height: 24px;
}

.chat-textarea:focus {
    outline: none;
}

.chat-textarea::placeholder {
    color: #6b7280;
}

.send-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #00f5ff, #0099cc);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 245, 255, 0.4);
}

.send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.5;
}

.input-footer {
    margin-top: 0.75rem;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-text {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Improved Message Text Formatting */
.message-text {
    color: #e1e5e9;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-text code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

/* Mobile Responsiveness for New Elements */
@media (max-width: 768px) {
    .chat-elements-container {
        padding: 1.5rem 1rem;
    }

    .chat-window-title {
        font-size: 1.5rem;
    }

    .chat-window-subtitle {
        font-size: 0.9rem;
    }

    .suggestion-cards {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .suggestion-card {
        padding: 0.875rem 1rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .message-actions {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .suggestion-text {
        font-size: 0.85rem;
    }

    .message-group {
        max-width: 95%;
    }
}
