/* ============================================
   Command Palette & Modals
   ============================================ */

/* Command Palette */
.command-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 15vh;
    z-index: 10000;
    opacity: 0; visibility: hidden;
    transition: all 0.15s;
}
.command-overlay.visible { opacity: 1; visibility: visible; }

.command-palette {
    width: 560px; max-height: 450px;
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.command-input-wrapper {
    display: flex; align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-primary);
    gap: 12px;
}
.command-input-wrapper i { color: var(--text-muted); font-size: 14px; }
.command-input { flex: 1; background: transparent; border: none; color: var(--text-primary); font-size: 15px; outline: none; }
.command-input::placeholder { color: var(--text-muted); }
.command-results { max-height: 380px; overflow-y: auto; padding: 8px; }
.command-group-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; padding: 10px 12px 6px; }
.command-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.command-item:hover, .command-item.selected { background: var(--bg-hover); }
.command-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border-radius: 6px; color: var(--text-secondary); font-size: 12px; }
.command-text { flex: 1; }
.command-title { font-size: 13px; }
.command-desc { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.command-shortcut { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); background: var(--bg-card); padding: 3px 8px; border-radius: 4px; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 10001;
    opacity: 0; visibility: hidden;
    transition: all 0.2s;
}
.modal-overlay.visible { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    width: 90%; max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}
.modal-overlay.visible .modal { transform: scale(1); }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 4px;
    color: var(--text-muted); cursor: pointer; font-size: 16px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border-primary); background: var(--bg-card); }

/* Form Elements */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 10px; color: var(--text-muted); margin-top: 6px; }

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent-blue); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border-primary); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: 6px; color: var(--text-muted); cursor: pointer; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.active { color: var(--accent-orange); }
