/* AI Assistant Page Styles */

.ai-chat-shell {
    display: flex;
    flex-direction: column;
    height: 520px;
    padding: 0;
    overflow: hidden;
}

.ai-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.5) 100%);
}

.ai-chat-thread::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-thread::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-thread::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.ai-chat-thread::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0;
    transition: transform 0.2s ease;
    animation: slideIn 0.3s ease-out;
}

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

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

.message-user .message-content {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.15) 100%);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px 20px 6px 20px;
    padding: 1.125rem 1.35rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    max-width: 75%;
}

.message-assistant .message-content {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(99, 102, 241, 0.15) 100%);
    border: 1.5px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px 20px 20px 6px;
    padding: 1.125rem 1.35rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    max-width: 85%;
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(99, 102, 241, 0.2) 100%);
    border: 2px solid rgba(139, 92, 246, 0.4);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.message-user .message-avatar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.2) 100%);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.message-avatar svg {
    width: 22px;
    height: 22px;
    color: #a78bfa;
}

.message-user .message-avatar svg {
    color: #60a5fa;
}

.message-content {
    /* Styling moved to .message-user .message-content and .message-assistant .message-content */
}

.message-content strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.message-content p {
    margin: 0.5rem 0;
    color: var(--text-primary);
    line-height: 1.7;
    word-break: break-word;
    font-size: 0.95rem;
}

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

.message-content ul {
    margin: 0.75rem 0 0.5rem;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.message-system {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0;
}

.typing-indicator .message-content {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.12) 100%);
    border: 1.5px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px 20px 20px 6px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

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

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.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(-8px);
        opacity: 1;
    }
}

.ai-chat-input {
    border-top: 2px solid rgba(139, 92, 246, 0.2);
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.85) 100%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.ai-chat-controls {
    display: flex;
    gap: 0.85rem;
    align-items: flex-end;
}

.ai-chat-controls .input-field {
    flex: 1;
}

.ai-chat-controls input {
    border-radius: 16px;
    border: 2px solid rgba(139, 92, 246, 0.25);
    background: linear-gradient(145deg, rgba(10, 16, 28, 0.95) 0%, rgba(10, 16, 28, 0.9) 100%);
    padding: 0.95rem 1.25rem;
    transition: all 0.3s ease;
}

.ai-chat-controls input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.ai-chat-controls button {
    border-radius: 14px;
    padding: 0.95rem 1.75rem;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-controls button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.ai-chat-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .ai-chat-shell {
        height: 460px;
    }

    .ai-chat-thread {
        padding: 1rem;
    }

    .message {
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
    }
}

/* Vehicle card shared styles */
.vehicle-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.vehicle-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.vehicle-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vehicle-icon svg {
    width: 32px;
    height: 32px;
    color: var(--accent-blue);
}

.vehicle-nickname {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.12);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.vehicle-actions {
    display: flex;
    gap: 0.5rem;
}

.vehicle-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.vehicle-card-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.vehicle-card-model {
    font-size: 1rem;
    color: var(--text-secondary);
}

.vehicle-card-vin {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    word-break: break-all;
}
