/* Specific Component Styles */

/* --- Chat Interface --- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Mobile full height logic is handled by flex wrapper */
    min-height: 60vh;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    padding-right: 4px;
    /* Scrollbar space */
}

.chat-bubble {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    max-width: 85%;
    line-height: 1.5;
    font-size: 1.1rem;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: popIn 0.3s var(--bounce);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
    align-self: flex-start;
    background: white;
    /* Contrast against bg */
    color: var(--color-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--color-border);
}

.chat-input-area {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    background: white;
    padding: var(--spacing-sm);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border);
}

#chat-input {
    flex: 1;
    margin-bottom: 0;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1.1rem;
    background: transparent;
}

#chat-input:focus {
    box-shadow: none;
}

#chat-send {
    background: var(--color-accent);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Circle Button */
    font-weight: 600;
    font-size: 1.2rem;
    transition: transform 0.2s var(--bounce);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#chat-send:active {
    transform: scale(0.8);
}

/* --- Robot Grid (Big Cards) --- */
.robot-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile First: 1 col */
    gap: var(--spacing-md);
}

@media (min-width: 600px) {
    .robot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.robot-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s var(--bounce);
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.robot-card:active {
    transform: scale(0.97);
}

.robot-card.active-robot {
    border-color: var(--color-primary);
    background: #f0f7ff;
}

.robot-icon {
    font-size: 2.5rem;
    background: #f1f5f9;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.robot-info {
    flex: 1;
    text-align: left;
}

.robot-name {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.robot-desc {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.active-badge {
    color: var(--color-primary);
    font-size: 1.5rem;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-actions button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9 !important;
    /* Force bg */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem !important;
    opacity: 1 !important;
}

.card-actions button:active {
    background: #e2e8f0 !important;
}

/* --- Wizard Modal (Mobile Popup) --- */
.modal {
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 90% !important;
    max-width: 400px;
    border-radius: var(--radius-xl) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2) !important;
    animation: slideUpModal 0.4s var(--bounce);
}

@keyframes slideUpModal {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.color-dot {
    width: 40px !important;
    height: 40px !important;
    transition: transform 0.2s var(--bounce);
}

.color-dot:active {
    transform: scale(0.8);
}