/* src/css/overlays.css - 所有叠加层和弹出窗口的样式 */

/* --- 上下文菜单 --- */
.context-menu {
    position: absolute;
    z-index: 10000;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow-color);
    padding: 5px 0;
    min-width: 160px;
    list-style: none;
    display: none;
}
.context-menu.visible { display: block; }
.context-menu-item {
    padding: 8px 15px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.context-menu-item:hover {
    background-color: var(--accent-color);
    color: white;
}
.context-menu-item i { width: 14px; text-align: center; }
.context-menu-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

/* --- 模态框 --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal {
    background-color: var(--bg-panel);
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow-color);
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.modal-overlay.visible .modal { transform: translateY(0); opacity: 1; }
.modal-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.1rem; margin: 0; }
.modal-close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; }
.modal-close-btn:hover { color: var(--text-primary); }
.modal-body { padding: 20px; font-size: 0.95rem; line-height: 1.6; }
.modal-body input, .modal-body select, .modal-body textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 4px;
    outline: none;
    margin-top: 10px;
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { border-color: var(--accent-color); }
.modal-body label { display: block; margin-top: 15px; font-size: 0.9rem; color: var(--text-secondary); }
.settings-modal-body .settings-item { margin-bottom: 15px; display: flex; flex-direction: column; gap: 5px; }
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin: -20px -20px 20px -20px;
    padding: 0 20px;
}
.modal-tab {
    background: none;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}
.modal-tab:hover { color: var(--text-primary); }
.modal-tab.active { color: var(--accent-color); font-weight: bold; border-bottom-color: var(--accent-color); }
.modal-tab-content .tab-pane { display: none; }
.modal-tab-content .tab-pane.active { display: block; }
.repo-item-label { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; cursor: pointer; border-bottom: 1px solid var(--border-color); transition: background-color 0.2s; }
.repo-item-label:last-child { border-bottom: none; }
.repo-item-label:hover { background-color: var(--selection-color); }
.repo-item-label.selected { background-color: var(--accent-color); color: #fff; }
.repo-item-label.selected strong, .repo-item-label.selected p { color: #fff; }
.repo-item-details { flex-grow: 1; margin-right: 15px; line-height: 1.4; }
.repo-item-details strong { color: var(--text-primary); font-size: 1rem; }
.repo-item-details p { font-size: 0.85em; color: var(--text-secondary); margin: 4px 0 0 0; }
.modal-footer { padding: 15px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }
.modal-action-btn { padding: 8px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; font-weight: bold; transition: background-color 0.2s, opacity 0.2s; }
.modal-action-btn.primary-btn { background-color: var(--accent-color); color: white; }
.modal-action-btn.primary-btn:hover:not(:disabled) { background-color: var(--accent-color-hover); }
.modal-action-btn.secondary-btn { background-color: var(--border-color); color: var(--text-primary); }
.modal-action-btn:disabled { opacity: 0.6; cursor: not-allowed; background-color: var(--border-color); }

/* --- 指令面板样式 --- */
.command-palette { display: flex; flex-direction: column; gap: 10px; }
.modal-search-input { width: 100%; padding: 12px; border: 1px solid var(--border-color); background-color: var(--bg-primary); color: var(--text-primary); border-radius: 4px; font-size: 1.1rem; outline: none; }
.modal-search-input:focus { border-color: var(--accent-color); }
.modal-list { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 4px; }
.modal-list-item { padding: 10px 15px; cursor: pointer; border-bottom: 1px solid var(--border-color); transition: background-color 0.2s; }
.modal-list-item:last-child { border-bottom: none; }
.modal-list-item:hover, .modal-list-item.active { background-color: var(--selection-color); }
.modal-list-item.disabled { color: var(--text-secondary); cursor: not-allowed; }
.modal-list-item .item-label { font-weight: bold; color: var(--text-primary); }
.modal-list-item .item-description { font-size: 0.85em; color: var(--text-secondary); margin-top: 4px; }

/* --- 功能引导 / Tour --- */
.tour-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10000; pointer-events: none; display: none; }
.tour-overlay.visible { display: block; }
.tour-highlight { position: relative; z-index: 10001; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6); pointer-events: auto; border-radius: 4px; transition: box-shadow 0.3s ease-in-out; }
.tour-popover { position: absolute; z-index: 10002; background-color: var(--bg-panel); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 5px 15px var(--shadow-color); padding: 15px; width: 300px; max-width: 90vw; pointer-events: auto; opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; }
.tour-popover.visible { opacity: 1; transform: translateY(0); }
.tour-popover h4 { margin-top: 0; margin-bottom: 10px; font-size: 1.1rem; color: var(--accent-color); }
.tour-popover p { margin-bottom: 15px; font-size: 0.9rem; line-height: 1.6; }
.tour-popover-footer { display: flex; justify-content: space-between; align-items: center; }
.tour-popover-steps { font-size: 0.8rem; color: var(--text-secondary); }
.tour-popover-nav button { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 10px; border-radius: 4px; cursor: pointer; margin-left: 5px; transition: background-color 0.2s, color 0.2s; }
.tour-popover-nav button:hover { background-color: var(--border-color); }
.tour-popover-nav button.primary { background-color: var(--accent-color); border-color: var(--accent-color); color: white; }
.tour-popover-nav button.primary:hover { background-color: var(--accent-color-hover); }

/* --- 环境设置面板样式 --- */
.settings-list { border: 1px solid var(--border-color); border-radius: 4px; max-height: 200px; overflow-y: auto; }
.settings-list-item { display: flex; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border-color); gap: 15px; }
.settings-list-item:last-child { border-bottom: none; }
.settings-list-item .jdk-key { font-weight: bold; color: var(--accent-color); flex-shrink: 0; width: 80px; }
.settings-list-item .jdk-path { flex-grow: 1; font-family: var(--font-family-mono); font-size: 0.85em; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-list-item .jdk-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 0.9em; padding: 4px; border-radius: 4px; }
.icon-btn:hover { background-color: var(--border-color); color: var(--text-primary); }
.settings-list-empty { padding: 15px; text-align: center; color: var(--text-secondary); font-style: italic; }