/* ===================== AI CHAT v6.0 — Stitch Design System ===================== */
/* AI Chat Panel, Messages, Input, Quick Actions, Welcome */

.ai-page-full {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ai-page-full .ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ---- WELCOME ---- */
.ai-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ai-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.ai-welcome h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-welcome p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ---- QUICK ACTIONS ---- */
.ai-quick-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
    width: 100%;
    max-width: 800px;
}

.ai-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: linear-gradient(145deg, rgba(24, 24, 27, 0.8), rgba(9, 9, 11, 0.6));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: var(--transition);
    text-align: center;
    flex: 1;
    min-width: 120px;
}

[data-theme="light"] .ai-quick-btn {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.7));
    border-color: rgba(0, 0, 0, 0.06);
}

.ai-quick-btn:hover {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ai-quick-btn span {
    font-size: 16px;
}

/* ---- MESSAGES ---- */
.ai-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    animation: msgSlide 0.25s ease;
    word-break: break-word;
    display: flex;
    flex-direction: column;
}

.ai-msg.user {
    align-self: flex-end;
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-msg.assistant {
    align-self: flex-start;
    background: var(--surface-dark);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
}

[data-theme="light"] .ai-msg.assistant {
    background: var(--bg-card);
    border-color: rgba(0, 0, 0, 0.06);
}

.ai-msg.system {
    align-self: center;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--accent-yellow);
    font-size: 11px;
    max-width: 90%;
}

.ai-msg img {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 6px;
}

@keyframes msgSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- INPUT AREA ---- */
.ai-input-area {
    padding: 16px 20px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

[data-theme="light"] .ai-input-area {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.ai-image-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
    margin-left: 4px;
}

.ai-image-preview img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ai-remove-img {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-red);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ai-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-input-row input {
    flex: 1;
    background: var(--surface-dark);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    padding: 12px 18px;
    font-size: 13px;
    outline: none;
    font-family: var(--font);
    transition: var(--transition);
}

[data-theme="light"] .ai-input-row input {
    background: var(--bg-input);
    border-color: rgba(0, 0, 0, 0.1);
}

.ai-input-row input:focus {
    border-color: rgba(255, 255, 255, 0.15);
}

.ai-input-row button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-body);
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.ai-input-row button:hover {
    opacity: 0.8;
}

.ai-input-row button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---- AI LAYOUT STATES ---- */
.ai-page-full:not(.has-msgs) {
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-page-full:not(.has-msgs) .ai-chat-messages {
    flex: 0 0 auto !important;
    width: 100%;
}

.ai-page-full:not(.has-msgs) #aiInteractiveBottom {
    margin: 0 !important;
}

.ai-page-full:not(.has-msgs) .ai-input-area {
    border-top: none;
    padding-bottom: 0;
    margin-bottom: auto;
}

.ai-page-full.has-msgs {
    justify-content: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-page-full.has-msgs .ai-chat-messages {
    flex: 1 1 auto !important;
    justify-content: flex-start !important;
}

.ai-page-full.has-msgs .ai-welcome {
    display: none !important;
}

.ai-page-full.has-msgs .ai-quick-actions {
    display: none !important;
}

.ai-page-full.has-msgs #aiInteractiveBottom {
    margin-bottom: 0 !important;
    padding-bottom: 24px !important;
}

@keyframes geminiEntrance {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}