/* suggestions.css - Agent建议、文件建议、深度模式指示器、响应式布局 */

/* Agent Suggestions */
.agent-suggestions {
    position: fixed;
    display: none;
    background: var(--bg-secondary);
    border: 2px solid var(--border-sketch);
    border-radius: 12px;
    box-shadow: 3px 4px 0px rgba(60, 50, 30, 0.12);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.agent-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 1px dashed var(--border-color);
}

.agent-suggestion-item:last-child {
    border-bottom: none;
}

.agent-suggestion-item:hover,
.agent-suggestion-item.selected {
    background: var(--accent-light);
}

.agent-suggestion-name {
    font-family: var(--font-hand);
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 4px;
    font-size: 16px;
}

.agent-suggestion-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* File Suggestions */
.file-suggestions {
    position: fixed;
    display: none;
    background: var(--bg-secondary);
    border: 2px solid var(--border-sketch);
    border-radius: 12px;
    box-shadow: 3px 4px 0px rgba(60, 50, 30, 0.12);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.file-suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-suggestion-item:last-child {
    border-bottom: none;
}

.file-suggestion-item:hover,
.file-suggestion-item.selected {
    background: var(--info-light);
}

.file-suggestion-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.file-suggestion-icon svg {
    width: 100%;
    height: 100%;
}

.file-suggestion-parent .file-suggestion-icon {
    color: var(--accent-primary);
}

.file-suggestion-info {
    flex: 1;
    min-width: 0;
}

.file-suggestion-name {
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-suggestion-path {
    font-size: 11px;
    color: var(--info);
    font-family: 'SF Mono', Monaco, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-suggestion-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* 进入文件夹按钮 */
.file-enter-folder-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.15s ease;
    margin-left: auto;
}

.file-enter-folder-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.file-enter-folder-btn svg {
    width: 14px;
    height: 14px;
}

/* Deep Mode Indicator */
.deep-mode-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--accent-light), rgba(107, 127, 198, 0.12));
    border: 2px solid var(--accent-primary);
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 500;
    animation: deepPulse 3s infinite;
}

.deep-mode-indicator.active {
    display: flex;
}

.deep-mode-indicator svg {
    width: 14px;
    height: 14px;
}

@keyframes deepPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(107, 127, 198, 0.2);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(107, 127, 198, 0);
    }
}

/* Current Context Indicator — 当前工作上下文指示器（移动端和桌面端通用） */
.current-context-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-context-indicator.active {
    display: inline-flex;
}

.current-context-indicator.agent-active {
    background: var(--warning-light);
    border: 2px solid var(--warning);
    color: var(--warning);
}

.current-context-indicator svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.current-context-indicator .context-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-context-indicator .context-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.15s;
    flex-shrink: 0;
    padding: 0;
    margin-left: 2px;
}

.current-context-indicator .context-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

.current-context-indicator .context-dismiss svg {
    width: 12px;
    height: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 99;
        transform: translateX(-100%);
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: none;
    }

    /* 移动端侧边栏遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(40, 35, 25, 0.35);
        z-index: 98;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .chat-container {
        padding: 0 12px;
    }

    .input-container {
        padding: 8px 0 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .input-wrapper {
        padding: 10px 12px;
        gap: 8px;
    }

    /* 移动端上下文指示器隐藏，改用工具栏内嵌标签 */
    .current-context-indicator {
        display: none !important;
    }

    .welcome-message {
        padding: 40px 16px;
    }

    .welcome-message h2 {
        font-size: 24px;
    }

    .welcome-tips {
        flex-direction: column;
        align-items: center;
    }

    /* 快速导航在移动端隐藏（由移动端工具栏替代） */
    .quick-nav-wrapper {
        display: none !important;
    }

    /* 回到底部按钮：移动端不需要偏移侧边栏宽度 */
    .scroll-to-bottom {
        transform: translateX(-50%) translateY(0);
        bottom: 130px;
    }

    .scroll-to-bottom:hover {
        transform: translateX(-50%) translateY(-2px);
    }

    /* 移动端工具栏 */
    .mobile-toolbar {
        display: flex;
    }

    /* 侧边栏会话操作按钮：移动端始终可见（触屏无 hover） */
    .sidebar-session-actions {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-session-menu-trigger {
        min-width: 36px;
        min-height: 36px;
    }

    /* 建议弹窗移动端更紧凑 */
    .agent-suggestions,
    .file-suggestions {
        max-height: 260px;
        border-radius: 10px;
    }

    .agent-suggestion-item {
        padding: 8px 12px;
    }

    .agent-suggestion-name {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .agent-suggestion-desc {
        font-size: 11px;
        line-height: 1.3;
    }

    .file-suggestion-item {
        padding: 7px 10px;
        gap: 8px;
    }

    .file-suggestion-icon {
        width: 16px;
        height: 16px;
        margin-right: 4px;
    }

    .file-suggestion-name {
        font-size: 12px;
    }

    .file-suggestion-path {
        font-size: 10px;
    }

    .file-suggestion-meta {
        font-size: 10px;
    }

    /* 进入文件夹按钮在移动端更大便于触摸 */
    .file-enter-folder-btn {
        width: 36px;
        height: 36px;
    }
}
