/* AI Workbench — Chat Interface
   ============================== */

.workbench {
    display: flex;
    gap: 24px;
    height: calc(100vh - 120px);
}

/* Conversations Panel */
.wb-conversations {
    width: 280px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.wb-conv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wb-title {
    font-size: 20px;
    font-weight: 500;
}

.wb-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.conv-item {
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-liquid);
    margin-bottom: 4px;
}

.conv-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.conv-item.active {
    background: var(--bg-elevated);
}

.conv-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.conv-item-preview {
    font-size: 12px;
    color: var(--fg-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conv-item-time {
    font-size: 11px;
    color: var(--fg-dim);
    margin-top: 4px;
    display: block;
}

/* Chat Area */
.wb-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wb-chat-header {
    margin-bottom: 16px;
}

.wb-chat-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wb-conv-title {
    font-size: 18px;
    font-weight: 500;
    flex: 1;
}

.wb-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wb-status-text {
    font-size: 12px;
    color: var(--fg-muted);
}

/* Task Type Selector */
.wb-task-types {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.task-type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--fg-muted);
    transition: all 0.3s var(--ease-liquid);
}

.task-type-btn:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.03);
}

.task-type-btn.active {
    background: var(--bg-elevated);
    color: var(--fg);
}

.task-type-icon {
    display: flex;
}

.task-type-icon svg {
    width: 14px;
    height: 14px;
}

.wb-route-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--fg-dim);
    font-family: var(--font-mono);
    margin-left: 8px;
}

.route-chevron {
    display: flex;
    color: var(--fg-dim);
}

.route-chevron svg {
    width: 12px;
    height: 12px;
}

.route-model {
    font-family: var(--font-mono);
}

/* Messages Area */
.wb-messages {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.message-flow {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

.message {
    max-width: 75%;
    padding: 16px 20px;
    border-radius: 16px;
    animation: fade-in 0.4s ease-out;
}

.message.user {
    margin-left: auto;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.message.assistant {
    margin-right: auto;
    background: var(--bg-layer-1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.message.thinking {
    position: relative;
    overflow: hidden;
}

.message.thinking::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    background-size: 200% 100%;
    animation: process-flow 2s linear infinite;
}

.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--fg-muted);
    position: relative;
    z-index: 1;
}

.message-provider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--fg-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.provider-name {
    font-family: var(--font-mono);
}

.provider-sep {
    opacity: 0.4;
}

.provider-model {
    font-family: var(--font-mono);
    font-size: 10px;
}

.message-text {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Input Area */
.wb-input-area {
    padding-top: 16px;
}

.wb-input-form {
    display: flex;
    gap: 12px;
    background: var(--bg-layer-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 6px 6px 20px;
    transition: all 0.3s var(--ease-liquid);
}

.wb-input-form:focus-within {
    background: var(--bg-layer-2);
    border-color: var(--border-hover);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.02);
}

.wb-input {
    flex: 1;
    padding: 10px 0;
    font-size: 14px;
    background: transparent;
    color: var(--fg);
}

.wb-input::placeholder {
    color: var(--fg-dim);
}

.wb-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary-fg);
    transition: all 0.3s var(--ease-liquid);
    flex-shrink: 0;
}

.wb-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.wb-send-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .wb-conversations {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .workbench {
        flex-direction: column;
        height: calc(100vh - 100px);
        gap: 16px;
    }
    .wb-conversations {
        width: 100%;
        max-height: none;
        flex-shrink: 0;
    }
    .wb-conv-list {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        padding: 8px 0;
        -webkit-overflow-scrolling: touch;
    }
    .conv-item {
        min-width: 200px;
        flex-shrink: 0;
        margin-bottom: 0;
    }
    .wb-task-types {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .task-type-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .message {
        max-width: 90%;
        padding: 14px 16px;
    }
    .message-flow {
        padding: 16px 8px;
    }
    .wb-input-form {
        padding: 4px 4px 4px 16px;
    }
    .wb-route-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .wb-title {
        font-size: 18px;
    }
    .wb-conv-title {
        font-size: 16px;
    }
    .message {
        max-width: 95%;
    }
}
