/* ===================================
   AI ASSISTANT PAGE - MOBILE-FIRST
   Modern, beautiful chat interface
   =================================== */

/* ===================================
   HERO SECTION
   =================================== */

.assistant-hero {
    text-align: center;
    padding: 1.5rem 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 50%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.assistant-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

.assistant-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    border-radius: 24px;
    margin-bottom: 1rem;
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.4),
                0 0 60px rgba(139, 92, 246, 0.2);
    position: relative;
    z-index: 1;
}

.assistant-icon svg {
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.assistant-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.assistant-subtitle {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===================================
   VEHICLE SELECTOR
   =================================== */

.assistant-vehicle-selector {
    padding: 0.75rem;
    margin-top: 0.75rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.assistant-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.assistant-select {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(145deg, rgba(10, 16, 28, 0.95) 0%, rgba(10, 16, 28, 0.9) 100%);
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.assistant-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15),
                inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.assistant-select option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* ===================================
   CHAT CARD
   =================================== */

.assistant-chat-card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 300px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 50%, rgba(17, 24, 39, 0.95) 100%);
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    margin: 0.75rem 0.5rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
                0 0 40px rgba(139, 92, 246, 0.1),
                inset 0 1px 2px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* ===================================
   CHAT THREAD (MESSAGES)
   =================================== */

.assistant-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-primary);
}

/* Welcome message */
.message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.message-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    border-radius: 10px;
    color: white;
}

.message-user .message-avatar {
    background: var(--border-color);
    color: var(--text-primary);
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-content strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.message-content p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.message-content ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.message-content li {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.message-content em {
    color: #8b5cf6;
    font-style: normal;
    font-weight: 500;
}

/* System messages */
.message-system {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 8px;
}

/* ===================================
   CHAT INPUT
   =================================== */

.assistant-chat-input {
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.assistant-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.assistant-input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(145deg, rgba(10, 16, 28, 0.95) 0%, rgba(10, 16, 28, 0.9) 100%);
    border: 2px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.assistant-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15),
                inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.assistant-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    font-weight: 500;
}

.assistant-send-button {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4),
                0 0 40px rgba(139, 92, 246, 0.15);
}

.assistant-send-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(139, 92, 246, 0.5),
                0 0 50px rgba(139, 92, 246, 0.2);
}

.assistant-send-button:active {
    transform: translateY(-1px);
}

.assistant-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.assistant-send-button svg {
    transition: transform 0.2s ease;
}

.assistant-send-button:hover svg {
    transform: translateX(2px);
}

.assistant-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
}

/* ===================================
   LOADING STATE
   =================================== */

.assistant-send-button.loading {
    background: var(--border-color);
    pointer-events: none;
}

.assistant-send-button.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   RESPONSIVE - TABLET (768px+)
   =================================== */

@media (min-width: 768px) {
    .assistant-hero {
        padding: 2.5rem 2rem 2rem;
    }

    .assistant-title {
        font-size: 2.5rem;
    }

    .assistant-subtitle {
        font-size: 1rem;
    }

    .assistant-vehicle-selector {
        padding: 2rem;
    }

    .assistant-chat-card {
        margin: 2rem;
        height: calc(100vh - 480px);
    }

    .assistant-chat-thread {
        padding: 2rem;
    }

    .message-avatar {
        width: 40px;
        height: 40px;
    }

    .assistant-chat-input {
        padding: 2rem;
    }

    .assistant-input {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }

    .assistant-send-button {
        width: 52px;
        height: 52px;
    }
}

/* ===================================
   RESPONSIVE - DESKTOP (1024px+)
   =================================== */

@media (min-width: 1024px) {
    .assistant-page {
        max-width: 960px;
        margin: 0 auto;
    }

    .assistant-hero {
        padding: 3rem 2rem 2.5rem;
    }

    .assistant-icon {
        width: 96px;
        height: 96px;
    }

    .assistant-icon svg {
        width: 56px;
        height: 56px;
    }

    .assistant-title {
        font-size: 3rem;
    }

    .assistant-subtitle {
        font-size: 1.125rem;
    }

    .assistant-chat-card {
        height: 600px;
    }

    .message-content p,
    .message-content li {
        font-size: 1rem;
    }
}

/* ===================================
   MOBILE NAV SPACING
   =================================== */

@media (max-width: 768px) {
    .has-mobile-nav .assistant-chat-card {
        height: calc(100vh - 380px - 70px);
        /* 380px = hero + selector, 70px = mobile nav */
    }
}

/* ===================================
   SCROLLBAR STYLING
   =================================== */

.assistant-chat-thread::-webkit-scrollbar {
    width: 8px;
}

.assistant-chat-thread::-webkit-scrollbar-track {
    background: transparent;
}

.assistant-chat-thread::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.assistant-chat-thread::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===================================
   DARK MODE ADJUSTMENTS
   =================================== */

@media (prefers-color-scheme: dark) {
    .assistant-hero {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
    }

    .message-system {
        background: rgba(139, 92, 246, 0.08);
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
    .assistant-send-button,
    .assistant-send-button svg,
    .assistant-input,
    .assistant-select {
        transition: none;
    }

    .assistant-send-button:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .assistant-icon,
    .assistant-send-button {
        border: 2px solid currentColor;
    }

    .assistant-input,
    .assistant-select {
        border-width: 3px;
    }
}

/* ============================================
   360PX ULTRA-SMALL DEVICE BREAKPOINT
   ============================================ */

@media (max-width: 360px) {
    .assistant-page {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .assistant-header {
        padding: 1rem 0.75rem;
    }

    .assistant-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .assistant-header p {
        font-size: 0.9rem;
    }

    .assistant-icon {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }

    .assistant-options {
        gap: 0.5rem;
    }

    .assistant-option {
        padding: 0.75rem;
        border-radius: 8px;
        font-size: 0.85rem;
    }

    .assistant-chat {
        max-height: calc(100vh - 220px);
    }

    .assistant-message {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }

    .assistant-message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .assistant-input-group {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .assistant-input,
    .assistant-select {
        padding: 0.75rem;
        font-size: 14px;
        border-radius: 8px;
    }

    .assistant-send-button {
        padding: 0.75rem;
        min-width: 40px;
        min-height: 40px;
    }

    .assistant-send-button svg {
        width: 18px;
        height: 18px;
    }

    .assistant-preset-buttons {
        gap: 0.5rem;
    }

    .assistant-preset-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
}
