/* assistants.css - Assistants section */

/* ---- ASSISTANT CHAT HEADER ---- */
.assistant-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.assistant-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.assistant-header-back:hover { background: var(--bg-tertiary); color: var(--text); }
.assistant-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    flex-shrink: 0;
    filter: saturate(0.55);
}
.assistant-header-icon svg { width: 20px; height: 20px; }
.assistant-header-info { display: flex; flex-direction: column; gap: 1px; }
.assistant-header-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.assistant-header-label { font-size: 0.75rem; color: var(--text-secondary); }

.assistants-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.assistants-header {
    margin-bottom: 24px;
}
.assistants-header h3 {
    font-size: 20px;
    font-weight: 600;
}
.assistants-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 16px;
}

/* Grid */
.assistants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.assistants-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}
.assistants-empty p {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 12px 0 20px;
    max-width: 360px;
}

/* Card */
.assistant-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    transition: all var(--transition);
    cursor: pointer;
}
.assistant-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.assistant-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.assistant-card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    filter: saturate(0.55);
}

.assistant-card-menu {
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    gap: 2px;
}
.assistant-card:hover .assistant-card-menu { opacity: 1; }

.assistant-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.assistant-card-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Icon picker */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.icon-pick {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.icon-pick:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.icon-pick.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* Color picker */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.color-pick {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}
.color-pick:hover {
    transform: scale(1.2);
}
.color-pick.selected {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

/* Larger modal for assistant create/edit */
.modal-content-lg {
    max-width: 540px;
}
.modal-content-lg textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text);
    resize: vertical;
    box-sizing: border-box;
}
.modal-content-lg textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg);
}

/* ============ SIDEBAR ASSISTANT SUB-ITEMS ============ */
.sidebar-assistants-list {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
}
.sidebar-assistant-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-assistant-item:hover {
    background: var(--bg-secondary);
    color: var(--text);
}
.sidebar-assistant-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
}
.sidebar-assistant-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============ ASSISTANT ARCHIVE ADD BAR ============ */
.assistant-archive-add-bar {
    padding: 8px 0;
}

/* ============ MODE SELECTION ============ */
.assistant-mode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.assistant-mode-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}
.assistant-mode-option:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.assistant-mode-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}
.assistant-mode-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.assistant-mode-text strong {
    font-size: 15px;
    color: var(--text);
}
.assistant-mode-text span {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============ GEMINI CREATOR CHAT ============ */
.gemini-creator-chat {
    display: flex;
    flex-direction: column;
    height: 420px;
}
.gemini-creator-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gc-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.gc-message-ai {
    align-self: flex-start;
    background: var(--bg-secondary);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.gc-message-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.gc-message-content {
    word-wrap: break-word;
}
.gc-message-content p {
    margin: 0 0 6px;
}
.gc-message-content p:last-child {
    margin-bottom: 0;
}
.gc-message-content strong {
    font-weight: 600;
}

/* Typing indicator */
.gemini-creator-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
}
.gemini-creator-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: gcTyping 1.4s infinite ease-in-out;
}
.gemini-creator-typing span:nth-child(2) { animation-delay: 0.2s; }
.gemini-creator-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes gcTyping {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input row */
.gemini-creator-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.gemini-creator-input-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text);
    outline: none;
}
.gemini-creator-input-row input:focus {
    border-color: var(--primary);
    background: var(--bg);
}
.gemini-creator-input-row .btn {
    min-width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
}
.gemini-creator-input-row .btn:hover {
    background: var(--primary-hover);
}

/* Confirm card */
.gc-confirm-card {
    margin: 8px 0;
    padding: 16px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    background: var(--primary-light, #4F46E508);
}
.gc-confirm-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.gc-confirm-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}
.gc-confirm-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gc-confirm-info strong {
    font-size: 15px;
    color: var(--text);
}
.gc-confirm-info span {
    font-size: 12px;
    color: var(--text-secondary);
}
.gc-confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.gc-confirm-success {
    border-color: #4A8C6F;
    background: #4A8C6F08;
}
.gc-confirm-success .gc-confirm-preview {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .assistants-grid {
        grid-template-columns: 1fr;
    }
    .assistant-card-menu { opacity: 1; }
    .gemini-creator-chat {
        height: 360px;
    }
}
